Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk export button for saved queries doesn't perform any action #26885

Closed
3 tasks done
Maleware opened this issue Jan 30, 2024 · 1 comment · Fixed by #26889
Closed
3 tasks done

Bulk export button for saved queries doesn't perform any action #26885

Maleware opened this issue Jan 30, 2024 · 1 comment · Fixed by #26889

Comments

@Maleware
Copy link

Bug description

In superset 3.0.1 you can go to sql -> saved queries and select all available queries. The button "Bulk select" appears and can be clicked but doesn't perform any action.

How to reproduce the bug

  1. Go to sql -> saved queries
  2. Press bulk select
  3. select an arbitrary number of queries
  4. Bulk button appears -> Click it

I would expect now having a download somewhere, but nothing happens.

Screenshots/recordings

Screenshot 2024-01-30 at 15 29 48

Superset version

3.0.3

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@Maleware
Copy link
Author

A little research later:

we found in this file /stackable/app/lib64/python3.9/site-packages/superset/queries/saved_queries/commands/export.py in class ExportSavedQueriesCommand the function def _export where the filename is build, that the model.schema is an optional field.

However, the code doesn't handle it properly and gives the None-Type into secure_filename which then throws an exception since it can't handle the None-Type:

2024-01-30 14:53:10,852:ERROR:flask_appbuilder.api:normalize() argument 2 must be str, not None                                                                          
Traceback (most recent call last):                                                                                                                                       
  File "/stackable/app/lib64/python3.9/site-packages/flask_appbuilder/api/__init__.py", line 110, in wraps                                                               
    return f(self, *args, **kwargs)                                                                                                                                      
  File "/stackable/app/lib64/python3.9/site-packages/superset/views/base_api.py", line 127, in wraps                                                                     
    raise ex                                                                                                                                                             
  File "/stackable/app/lib64/python3.9/site-packages/superset/views/base_api.py", line 121, in wraps                                                                     
    duration, response = time_function(f, self, *args, **kwargs)                                                                                                         
  File "/stackable/app/lib64/python3.9/site-packages/superset/utils/core.py", line 1526, in time_function                                                                
    response = func(*args, **kwargs)                                                                                                                                     
  File "/stackable/app/lib64/python3.9/site-packages/flask_appbuilder/api/__init__.py", line 182, in wraps                                                               
    return f(self, *args, **kwargs)                                                                                                                                      
  File "/stackable/app/lib64/python3.9/site-packages/superset/queries/saved_queries/api.py", line 271, in export                                                         
    for file_name, file_content in ExportSavedQueriesCommand(                                                                                                            
  File "/stackable/app/lib64/python3.9/site-packages/superset/commands/export/models.py", line 59, in run                                                                
    for file_name, file_content in self._export(model, self.export_related):                                                                                             
  File "/stackable/app/lib64/python3.9/site-packages/superset/queries/saved_queries/commands/export.py", line 45, in _export                                             
    schema_slug = model.schema                                                                                                                                           
  File "/stackable/app/lib64/python3.9/site-packages/werkzeug/utils.py", line 218, in secure_filename                                                                    
    filename = unicodedata.normalize("NFKD", filename)                                                                                                                   
TypeError: normalize() argument 2 must be str, not None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant