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

   ### Bug description
   
   If you have a model with name in any other than english language you get 
filename '_{id}' which will not be exported
   
   it is obvious from this code
   def get_filename(model_name: str, model_id: int, skip_id: bool = False) -> 
str:
       slug = secure_filename(model_name)
       filename = slug if skip_id else f"{slug}_{model_id}"
       return filename if slug else str(model_id)
   
   ### How to reproduce the bug
   
   1. Go to charts 
   2. Сreate chart "Пивко"
   3. Try to import the chart
   4. You get file with name _{id} in charts folder of zip archive
   5. Files with names starting with _ and - are not imported
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Safari
   
   ### Additional context
   
   Suggest to do smthing like:
   
   def get_filename(model_name: str, model_id: int, skip_id: bool = False) -> 
str:
       slug = secure_filename(model_name)
       slug = slug.replace('-', '').lstrip()
       filename = f"{slug}_{model_id}" if slug else "{model_id}"
       return filename
   
   ### Checklist
   
   - [X] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [X] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [X] 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.


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