This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new b8ca078 Fix for new Pandas API (#7975)
b8ca078 is described below
commit b8ca0783ffec74b84c03920ebd6a656be439f755
Author: Beto Dealmeida <[email protected]>
AuthorDate: Fri Aug 2 15:28:39 2019 -0700
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 65e5288..959b64f 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)