Skip to content

Commit

Permalink
fix(viz): time shift read-only error (apache#14191)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored Apr 16, 2021
1 parent cab110e commit fe21de3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,8 +1362,10 @@ def run_extra_queries(self) -> None:

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))

Expand Down

0 comments on commit fe21de3

Please sign in to comment.