From b8ca0783ffec74b84c03920ebd6a656be439f755 Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Fri, 2 Aug 2019 15:28:39 -0700 Subject: [PATCH] Fix for new Pandas API (#7975) --- superset/viz.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/superset/viz.py b/superset/viz.py index 65e528846..959b64f46 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -42,6 +42,7 @@ from markdown import markdown import numpy as np import pandas as pd from pandas.tseries.frequencies import to_offset +from pandas.tseries.offsets import DateOffset import polyline import simplejson as json @@ -1398,7 +1399,8 @@ class NVD3TimePivotViz(NVD3TimeSeriesViz): fd = self.form_data df = self.process_data(df) freq = to_offset(fd.get("freq")) - freq.normalize = True + freq = DateOffset(normalize=True, **freq.kwds) + df.index.name = None df[DTTM_ALIAS] = df.index.map(freq.rollback) df["ranked"] = df[DTTM_ALIAS].rank(method="dense", ascending=False) - 1 df.ranked = df.ranked.map(int)