mistercrunch commented on a change in pull request #7376: Fixing the examples
URL:
https://github.com/apache/incubator-superset/pull/7376#discussion_r278655323
##########
File path: superset/viz.py
##########
@@ -675,7 +675,7 @@ def get_data(self, df):
DTTM_ALIAS in df):
del df[DTTM_ALIAS]
- aggfunc = self.form_data.get('pandas_aggfunc')
+ aggfunc = self.form_data.get('pandas_aggfunc') or 'sum'
Review comment:
@betodealmeida this is an example of something that fails using the GET with
sliceId, but works through the UI (when using POST), because `pandas_aggfunc`
was added after examples were created, and the frontend sets a default for it
(`sum`) as it creates the POST request. In this particular case, the dashboard
view would use `GET` and the backend would fail since `pandas_aggfunc` is equal
to `None`.
When the frontend crafts the `POST`, it sets the default of this new control
to `sum` on the frontend and it succeeds.
Now this particular fix here is bad, as now we have the save default (`sum`)
defined in the backend and frontend. If someone was to change the default on
the frontend, the backend would use the old default only in get mode for some
charts that are missing the key...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]