hughhhh opened a new pull request, #21029: URL: https://github.com/apache/superset/pull/21029
<!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY <!--- Describe the change below, including rationale and design decisions --> When executing pivot v2 table report if the `verbose_map` doesn't match up with the df columns we are throwing this error for metric/values. To fix this for pivot v2 table we won't be using the verbose map to change the values/metrics names to have better alignment. ``` Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(*req.view_args) File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 89, in wraps return f(self, *args, *kwargs) File "/usr/local/lib/python3.8/site-packages/superset/views/base_api.py", line 113, in wraps raise ex File "/usr/local/lib/python3.8/site-packages/superset/views/base_api.py", line 110, in wraps duration, response = time_function(f, self, args, **kwargs) File "/usr/local/lib/python3.8/site-packages/superset/utils/core.py", line 1533, in time_function response = func(*args, *kwargs) File "/usr/local/lib/python3.8/site-packages/superset/utils/log.py", line 244, in wrapper value = f(args, **kwargs) File "/usr/local/lib/python3.8/site-packages/superset/charts/data/api.py", line 160, in get_data return self._get_data_response( File "/usr/local/lib/python3.8/site-packages/superset/charts/data/api.py", line 396, in _get_data_response return self._send_chart_response(result, form_data, datasource) File "/usr/local/lib/python3.8/site-packages/superset/charts/data/api.py", line 343, in _send_chart_response result = apply_post_process(result, form_data, datasource) File "/usr/local/lib/python3.8/site-packages/superset/charts/post_processing.py", line 339, in apply_post_process processed_df = post_processor(df, form_data, datasource) File "/usr/local/lib/python3.8/site-packages/superset/charts/post_processing.py", line 234, in pivot_table_v2 return pivot_df( File "/usr/local/lib/python3.8/site-packages/superset/charts/post_processing.py", line 89, in pivot_df df = df.pivot_table( File "/usr/local/lib/python3.8/site-packages/pandas/core/frame.py", line 7951, in pivot_table return pivot_table( File "/usr/local/lib/python3.8/site-packages/pandas/core/reshape/pivot.py", line 95, in pivot_table table = __internal_pivot_table( File "/usr/local/lib/python3.8/site-packages/pandas/core/reshape/pivot.py", line 141, in __internal_pivot_table raise KeyError(i) KeyError: 'COUNT()' ``` [Click here to view exception in pandas](https://github.com/pandas-dev/pandas/commit/8f7ba1baa7514379dbb0a70d6b032fbef9a88eb2) ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
