From fe21de3fc4d0aa5d5bb9ba150683a258f3bbe00c Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Fri, 16 Apr 2021 16:48:06 +0300 Subject: [PATCH] fix(viz): time shift read-only error (#14191) --- superset/viz.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/superset/viz.py b/superset/viz.py index 8063a9f8525..5bedc6b399f 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -1362,8 +1362,10 @@ class NVD3TimeSeriesViz(NVD3Viz): df2 = self.get_df_payload(query_object, time_compare=option).get("df") if df2 is not None and DTTM_ALIAS in df2: + dttm_series = df2[DTTM_ALIAS] + delta + df2 = df2.drop(DTTM_ALIAS, axis=1) + df2 = pd.concat([dttm_series, df2], axis=1) label = "{} offset".format(option) - df2[DTTM_ALIAS] += delta df2 = self.process_data(df2) self._extra_chart_data.append((label, df2))