Incubator-superset: Time-series Period Pivot - DateOffset objects are immutable

Created on 1 Aug 2019  路  4Comments  路  Source: apache/incubator-superset

Time-series Period from trunk is no more functional (used to work a couple of weeks ago),
The chart fails with the stack trace below.

Traceback (most recent call last):
File "/home/superset/venvSS/lib/python3.6/site-packages/superset/views/base.py", line 121, in wraps
return f(self, args, kwargs)
File "/home/superset/venvSS/lib/python3.6/site-packages/superset/utils/decorators.py", line 70, in wrapper
return f(
args, *kwargs)
File "/home/superset/venvSS/lib/python3.6/site-packages/superset/views/core.py", line 1119, in explore_json
viz_obj, csv=csv, query=query, results=results, samples=samples
File "/home/superset/venvSS/lib/python3.6/site-packages/superset/views/core.py", line 1046, in generate_json
payload = viz_obj.get_payload()
File "/home/superset/venvSS/lib/python3.6/site-packages/superset/viz.py", line 379, in get_payload
payload["data"] = self.get_data(df)
File "/home/superset/venvSS/lib/python3.6/site-packages/superset/viz.py", line 1401, in get_data
freq.normalize = True
File "pandas/_libs/tslibs/offsets.pyx", line 332, in pandas._libs.tslibs.offsets._BaseOffset.__setattr__
*
AttributeError: DateOffset objects are immutable.

#bug

Most helpful comment

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.97. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 4 comments

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.97. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

It seems DateOffset has been made immutable in pandas 0.24, and there was is no obvious solution to making the normalize attribute True. Let me think about this for a sec to see how it can be solved.

The chart is now working,
however in my setup the results are strange (time grain=day, last quarter, metric=count(*), freq=1week start monday)
The chart shows all points stuck on the first day of the week (no lines).

Screen Shot 2019-08-03 at 10 35 12

FYI @betodealmeida the fix only seems to work for certain offsets, reopening this. Posted the following on Pandas issue tracker: https://github.com/pandas-dev/pandas/issues/27728

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tmccartan picture tmccartan  路  3Comments

sashank picture sashank  路  3Comments

eliab picture eliab  路  3Comments

kalimuthu123 picture kalimuthu123  路  3Comments

lenguyenthedat picture lenguyenthedat  路  3Comments