superset icon indicating copy to clipboard operation
superset copied to clipboard

chore(export): Added ability to export chart YAML files with Unicode characters, fix #20331

Open xyb opened this issue 1 year ago • 5 comments

SUMMARY

Improve chart YAML export for multi-language users 🌐. Now every user can read and review their chart files in their native language.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

superset-unicode

TESTING INSTRUCTIONS

Set name of any charts/dashboard as below strings then export them:

  • Chinese: 中文
  • Japanese: にほんご
  • Russian: Русский язык

ADDITIONAL INFORMATION

  • [ ] Has associated issue:
  • [ ] Required feature flags:
  • [ ] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)
    • [ ] 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

xyb avatar Apr 12 '24 09:04 xyb

Thanks @xyb for the change. Would you mind adding either a unit or integration test?

john-bodley avatar Apr 12 '24 17:04 john-bodley

@john-bodley Certainly. I've previously dedicated some time to exploring the optimal location for writing unit tests, yet I was unable to identify an appropriate spot within the tests directory. Could you possibly offer some guidance on where the unit test code should be situated, and what would be the best approach to handling fixtures?

xyb avatar Apr 17 '24 08:04 xyb

@john-bodley Certainly. I've previously dedicated some time to exploring the optimal location for writing unit tests, yet I was unable to identify an appropriate spot within the tests directory. Could you possibly offer some guidance on where the unit test code should be situated, and what would be the best approach to handling fixtures?

Take a look at: https://github.com/apache/superset/blob/master/tests/integration_tests/charts/commands_tests.py

dpgaspar avatar Apr 22 '24 15:04 dpgaspar

@john-bodley @dpgaspar I've added some tests, but I'm not familiar with superset and its testing framework, I'd greatly appreciate it if someone could take a look at it and provide some guidance on how to improve it.

xyb avatar May 22 '24 10:05 xyb

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.50%. Comparing base (76d897e) to head (14d94f4). Report is 158 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #28008       +/-   ##
===========================================
+ Coverage   60.48%   83.50%   +23.01%     
===========================================
  Files        1931      522     -1409     
  Lines       76236    37482    -38754     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31298    -14816     
+ Misses      28017     6184    -21833     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 49.11% <0.00%> (-0.06%) :arrow_down:
javascript ?
mysql 77.18% <100.00%> (?)
postgres 77.30% <100.00%> (?)
presto 53.66% <0.00%> (-0.14%) :arrow_down:
python 83.50% <100.00%> (+20.01%) :arrow_up:
sqlite 76.79% <100.00%> (?)
unit 58.96% <40.00%> (+1.33%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 23 '24 21:05 codecov[bot]

@john-bodley @dpgaspar Before merging, are there any remaining changes or tasks I should complete to ensure a smooth merge?

xyb avatar Jul 20 '24 09:07 xyb

Thank you for adding the tests. We can merge this only if/when @dpgaspar re-reviews it :D

rusackas avatar Jul 25 '24 18:07 rusackas

@dpgaspar gently ping

xyb avatar Aug 30 '24 03:08 xyb

@villebro If there's anything I can do, please don't hesitate to let me know.

xyb avatar Sep 06 '24 11:09 xyb

Looks like this is stuck (again) in need of a rebase. Assuming this is still needed, let's see if we can get it through :D

rusackas avatar Apr 22 '25 21:04 rusackas

@rusackas rebased

xyb avatar May 07 '25 06:05 xyb