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: permission sqlalchemy events #21454

Merged
merged 6 commits into from
Sep 13, 2022

Conversation

dpgaspar
Copy link
Member

@dpgaspar dpgaspar commented Sep 13, 2022

SUMMARY

There can be cases where a session will not be able to query records just created by a SQLA event using a connection,
on:

connection.execute(view_menu_table.insert().values(name=view_menu_name))
            view_menu = self.find_view_menu(view_menu_name)

This PR fixes this problem by querying just inserted PVM's using connections also.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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 Sep 13, 2022

Codecov Report

Merging #21454 (07264e3) into master (9c285da) will decrease coverage by 11.21%.
The diff coverage is 100.00%.

❗ Current head 07264e3 differs from pull request most recent head 7989e43. Consider uploading reports for the commit 7989e43 to get more accurate results

@@             Coverage Diff             @@
##           master   #21454       +/-   ##
===========================================
- Coverage   66.53%   55.31%   -11.22%     
===========================================
  Files        1791     1791               
  Lines       68599    68537       -62     
  Branches     7320     7320               
===========================================
- Hits        45645    37914     -7731     
- Misses      21064    28733     +7669     
  Partials     1890     1890               
Flag Coverage Δ
hive 53.06% <100.00%> (+0.12%) ⬆️
mysql ?
postgres ?
presto 52.96% <100.00%> (+0.12%) ⬆️
python 58.06% <100.00%> (-23.19%) ⬇️
unit 51.07% <100.00%> (+0.11%) ⬆️

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

Impacted Files Coverage Δ
superset/security/manager.py 64.54% <100.00%> (-31.17%) ⬇️
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/key_value/commands/update.py 0.00% <0.00%> (-88.89%) ⬇️
superset/key_value/commands/delete.py 0.00% <0.00%> (-85.30%) ⬇️
superset/key_value/commands/delete_expired.py 0.00% <0.00%> (-80.77%) ⬇️
superset/dashboards/commands/importers/v0.py 15.62% <0.00%> (-76.25%) ⬇️
superset/datasets/commands/update.py 25.00% <0.00%> (-69.05%) ⬇️
superset/datasets/commands/create.py 31.25% <0.00%> (-68.75%) ⬇️
superset/datasets/commands/importers/v0.py 24.03% <0.00%> (-67.45%) ⬇️
superset/reports/commands/execute.py 24.64% <0.00%> (-66.91%) ⬇️
... and 283 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@craig-rueda craig-rueda left a comment

Choose a reason for hiding this comment

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

Argh - all these SQLA hooks :(

@jinghua-qa jinghua-qa merged commit 64d216a into apache:master Sep 13, 2022
@dpgaspar dpgaspar deleted the fix/permission-events branch September 13, 2022 21:22
zephyring pushed a commit to preset-io/superset that referenced this pull request Sep 15, 2022
@sadpandajoe
Copy link
Contributor

🏷️ preset:2022.35

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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.35 size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants