hakanonal opened a new issue, #23738:
URL: https://github.com/apache/superset/issues/23738

   When you want to export a PivotTable as pivoted CSV and if the SHOW COLUMNS 
TOTALS or SHOW ROW TOTALS are clicked then and 500 internal error page shows up 
instead of a CSV file to be downloaded. Please note that if none of the SHOW 
COLUMNS TOTALS and SHOW ROWS TOTALS is not clicked then there is no error. Here 
is the stack trace of the error in the docker app
   
   ```
   2023-04-19 10:57:24,551:ERROR:superset.views.base:count() got an unexpected 
keyword argument 'axis'
   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 "/app/superset/views/base_api.py", line 113, in wraps
       raise ex
     File "/app/superset/views/base_api.py", line 110, in wraps
       duration, response = time_function(f, self, *args, **kwargs)
     File "/app/superset/utils/core.py", line 1524, in time_function
       response = func(*args, **kwargs)
     File "/app/superset/utils/log.py", line 245, in wrapper
       value = f(*args, **kwargs)
     File "/app/superset/charts/data/api.py", line 244, in data
       return self._get_data_response(
     File "/app/superset/charts/data/api.py", line 396, in _get_data_response
       return self._send_chart_response(result, form_data, datasource)
     File "/app/superset/charts/data/api.py", line 343, in _send_chart_response
       result = apply_post_process(result, form_data, datasource)
     File "/app/superset/charts/post_processing.py", line 334, in 
apply_post_process
       processed_df = post_processor(df, form_data, datasource)
     File "/app/superset/charts/post_processing.py", line 234, in pivot_table_v2
       return pivot_df(
     File "/app/superset/charts/post_processing.py", line 172, in pivot_df
       subtotal = pivot_v2_aggfunc_map[aggfunc](
   TypeError: count() got an unexpected keyword argument 'axis'
   ```
   
   #### How to reproduce the bug
   
   1. Create a chart with type PivotTable
   2. Choose any dimensions and metrics you like
   3. Down below click in the options section click SHOW COLUMNS TOTALS or/and 
SHOW ROWS TOTALS
   4. click Update chart
   5. in the upper right corner click three dots to open settings menu of this 
chart.
   6. click Download -> Export to Pivoted .CSV option.
   7. see the 500 internal error
   
   
   
   ### Expected results
   
   I am expecting to download the CSV file.
   
   ### Actual results
   
   Instead of downloading a CSV file we are getting a 500 internal server error 
page like seen below.
   
   #### Screenshots
   
   <img width="316" alt="image" 
src="https://user-images.githubusercontent.com/2088468/233058557-11db4489-6031-45a4-b2b2-b03ce2d1887d.png";>
   
   <img width="1507" alt="image" 
src="https://user-images.githubusercontent.com/2088468/233058441-e5abd0dc-803c-4aba-ad1a-51f6ed329d04.png";>
   
   
   
   ### Environment
   
   - browser type and version: Safari 16.3
   - superset version: 2.0.1 (docker: apache/superset:2.0.1-dev)
   - python version: 3.8.12
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version 
of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar.


-- 
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]

Reply via email to