fix(viz): time shift read-only error (#14191)

This commit is contained in:
Ville Brofeldt 2021-04-16 16:48:06 +03:00 committed by GitHub
parent cab110e354
commit fe21de3fc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

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