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: dataset after insert when db relation does not exist #21492

Conversation

dpgaspar
Copy link
Member

@dpgaspar dpgaspar commented Sep 16, 2022

SUMMARY

Fixes a regression when loading examples would trigger dataset after_insert SQLAlchemy event with dataset.database as None, previously these triggers for creating new permissions were a noop and a second trigger would occur with the expected database relation. Currently the second event does not occur, so this PR will handle dataset.database as None by fetching the database model itself.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: after loading examples, not all datasource access permissions would be created (the number could vary)
Screenshot 2022-09-16 at 14 03 37

After: All permissions are created has expected (23 datasets create 23 datasource access permissions)
Screenshot 2022-09-16 at 11 52 27

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 16, 2022

Codecov Report

Merging #21492 (22175e0) into master (4fcc1d9) will decrease coverage by 1.49%.
The diff coverage is 83.13%.

❗ Current head 22175e0 differs from pull request most recent head e255133. Consider uploading reports for the commit e255133 to get more accurate results

@@            Coverage Diff             @@
##           master   #21492      +/-   ##
==========================================
- Coverage   66.67%   65.17%   -1.50%     
==========================================
  Files        1791     1793       +2     
  Lines       68459    68495      +36     
  Branches     7268     7277       +9     
==========================================
- Hits        45643    44644     -999     
- Misses      20955    21989    +1034     
- Partials     1861     1862       +1     
Flag Coverage Δ
hive ?
mysql 78.20% <92.45%> (+0.01%) ⬆️
postgres 78.27% <92.45%> (+0.01%) ⬆️
presto ?
python 78.33% <92.45%> (-3.07%) ⬇️
sqlite ?
unit ?

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

Impacted Files Coverage Δ
...et-ui-chart-controls/src/shared-controls/index.tsx 59.61% <0.00%> (-1.17%) ⬇️
.../superset-ui-core/src/query/normalizeTimeColumn.ts 100.00% <ø> (ø)
.../plugin-chart-echarts/src/Timeseries/buildQuery.ts 66.66% <ø> (ø)
...gin-chart-echarts/src/Timeseries/transformProps.ts 52.38% <0.00%> (-1.20%) ⬇️
...ontend/src/SqlLab/components/QuerySearch/index.tsx 73.07% <ø> (ø)
...rset-frontend/src/components/AsyncSelect/index.jsx 90.00% <ø> (ø)
...c/components/DeprecatedSelect/DeprecatedSelect.tsx 53.33% <ø> (ø)
...d/src/components/DeprecatedSelect/NativeSelect.tsx 57.14% <ø> (ø)
.../src/components/DeprecatedSelect/OnPasteSelect.jsx 78.37% <ø> (ø)
...precatedSelect/WindowedSelect/WindowedMenuList.tsx 4.76% <ø> (ø)
... and 83 more

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

@dpgaspar dpgaspar merged commit 7e2e8b8 into apache:master Sep 17, 2022
@dpgaspar dpgaspar deleted the danielgaspar/sc-58152/rbac-examples-dataset-schema-resources-aren branch September 17, 2022 16:16
@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 size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants