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

fix: Changes the return type of get_permissions to be JSON friendly #20472

Merged
merged 4 commits into from
Jun 22, 2022

Conversation

michael-s-molina
Copy link
Member

SUMMARY

Changes the return type of superset/views/utils/get_permissions to be JSON friendly. At Preset, we noticed a bunch of serialization errors because the permissions were returned as Set instead of List.

Big thanks to @zephyring for investigating the issue.

TESTING INSTRUCTIONS

Before merging, we'll deploy this fix to our test environments to make sure it fixes the issue.

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

@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #20472 (2dbed8e) into master (cf4f05e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #20472      +/-   ##
==========================================
+ Coverage   66.72%   66.75%   +0.02%     
==========================================
  Files        1739     1739              
  Lines       65130    65143      +13     
  Branches     6898     6898              
==========================================
+ Hits        43459    43483      +24     
+ Misses      19921    19910      -11     
  Partials     1750     1750              
Flag Coverage Δ
hive 53.71% <100.00%> (-0.02%) ⬇️
mysql 82.33% <100.00%> (?)
postgres 82.40% <100.00%> (+<0.01%) ⬆️
presto 53.57% <100.00%> (-0.02%) ⬇️
python 82.84% <100.00%> (+0.04%) ⬆️
sqlite 82.19% <100.00%> (+<0.01%) ⬆️
unit 50.55% <20.00%> (-0.03%) ⬇️

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

Impacted Files Coverage Δ
superset/views/utils.py 80.98% <100.00%> (+0.21%) ⬆️
superset/views/core.py 77.36% <0.00%> (+0.47%) ⬆️
superset/models/core.py 89.15% <0.00%> (+0.72%) ⬆️
superset/db_engine_specs/mysql.py 97.59% <0.00%> (+3.61%) ⬆️
superset/common/utils/dataframe_utils.py 92.85% <0.00%> (+7.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf4f05e...2dbed8e. Read the comment docs.

@rusackas
Copy link
Member

Hooray, CI passed!! I'll test it on Preset's environment.

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works! Code LGTM too :)

@rusackas rusackas merged commit a169b60 into apache:master Jun 22, 2022
michael-s-molina added a commit that referenced this pull request Jun 23, 2022
…20472)

* fix: Changes the return type of get_permissions to be JSON friendly

* Removes dangling comma

* Removes unused import

* Fixes typing errors

(cherry picked from commit a169b60)
@sadpandajoe
Copy link
Contributor

🏷️ preset:2022.25

sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Jun 23, 2022
…pache#20472)

* fix: Changes the return type of get_permissions to be JSON friendly

* Removes dangling comma

* Removes unused import

* Fixes typing errors

(cherry picked from commit a169b60)
michael-s-molina added a commit that referenced this pull request Jun 28, 2022
…20472)

* fix: Changes the return type of get_permissions to be JSON friendly

* Removes dangling comma

* Removes unused import

* Fixes typing errors

(cherry picked from commit a169b60)
@mistercrunch mistercrunch added 🍒 2.0.0 🍒 2.0.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:2022.25 size/S v2.0 🍒 2.0.0 🍒 2.0.1 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants