You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "jfrag1 (via GitHub)" <gi...@apache.org> on 2023/08/03 18:18:53 UTC
[GitHub] [superset] jfrag1 opened a new pull request, #24884: fix: Migration to fix out of sync schema_perm in charts and datasets
jfrag1 opened a new pull request, #24884:
URL: https://github.com/apache/superset/pull/24884
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
Currently, a bug exists in Superset where sometimes when updating a dataset's schema, the dataset and any charts belonging to the dataset's `schema_perm` attribute does not get updated properly. I've identified that this bug is the result of [this line](https://github.com/apache/superset/blob/554ef07eeda094f5bcc081e7a265e0b7408e0868/superset/security/manager.py#L1368) which checks if a dataset's schema was changed after a dataset update. Usually when the schema changes, both conditions are true/truthy, however sometimes `history_schema.deleted` is empty/falsy, which results in the `schema_perm` not getting updated.
This PR does not actually fix this bug; it just fixes any currently affected charts and datasets. The reasoning behind this is that there was another bug [recently fixed](https://github.com/apache/superset/pull/24815) which caused some datasets to be created without a schema, resulting in users needing the update dataset schemas more frequently than usual. This made the `schema_perm` bug here more impactful.
Additionally, actually fixing this bug is not simple. I initially thought we could remove the `history_schema.deleted` condition, but it turns out that the other condition `history_schema.has_changes()` is pretty much always true even when the schema has not changed, which would result in many unnecessary queries. I believe the long-term fix for this is either to move away from sqlalchemy event listeners/attribute history and instead handle this logic in the DAO layer and/or to rehaul the data model for data access permissions so that these permission strings are no longer needed
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [x] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [x] Migration is atomic, supports rollback & is backwards-compatible
- [x] Confirm DB migration upgrade and downgrade tested
- [x] Runtime estimates and downtime expectations provided - no downtime
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] sadpandajoe commented on pull request #24884: fix: Migration to fix out of sync schema_perm in charts and datasets
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on PR #24884:
URL: https://github.com/apache/superset/pull/24884#issuecomment-1668255255
π·οΈ preset:2023.31
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #24884: fix: Migration to fix out of sync schema_perm in charts and datasets
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #24884:
URL: https://github.com/apache/superset/pull/24884#issuecomment-1664439774
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/24884?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#24884](https://app.codecov.io/gh/apache/superset/pull/24884?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (52f1a55) into [master](https://app.codecov.io/gh/apache/superset/commit/b71541fb7fb1bdfd3e1eea59ee76de1f51e67e6b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (b71541f) will **decrease** coverage by `10.71%`.
> Report is 9 commits behind head on master.
> The diff coverage is `71.42%`.
> :exclamation: Current head 52f1a55 differs from pull request most recent head 2863d48. Consider uploading reports for the commit 2863d48 to get more accurate results
```diff
@@ Coverage Diff @@
## master #24884 +/- ##
===========================================
- Coverage 69.00% 58.30% -10.71%
===========================================
Files 1906 1906
Lines 74141 74142 +1
Branches 8209 8208 -1
===========================================
- Hits 51161 43228 -7933
- Misses 20859 28791 +7932
- Partials 2121 2123 +2
```
| Flag | Coverage Ξ | |
|---|---|---|
| hive | `?` | |
| mysql | `?` | |
| postgres | `?` | |
| presto | `54.03% <ΓΈ> (ΓΈ)` | |
| python | `60.99% <ΓΈ> (-22.38%)` | :arrow_down: |
| sqlite | `?` | |
| unit | `55.00% <ΓΈ> (ΓΈ)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Files Changed](https://app.codecov.io/gh/apache/superset/pull/24884?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ | |
|---|---|---|
| [...s/legacy-plugin-chart-country-map/src/countries.ts](https://app.codecov.io/gh/apache/superset/pull/24884?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcGx1Z2luLWNoYXJ0LWNvdW50cnktbWFwL3NyYy9jb3VudHJpZXMudHM=) | `100.00% <ΓΈ> (ΓΈ)` | |
| [...t-frontend/src/explore/actions/saveModalActions.js](https://app.codecov.io/gh/apache/superset/pull/24884?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvYWN0aW9ucy9zYXZlTW9kYWxBY3Rpb25zLmpz) | `95.52% <ΓΈ> (ΓΈ)` | |
| [...c/features/datasets/AddDataset/LeftPanel/index.tsx](https://app.codecov.io/gh/apache/superset/pull/24884?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZlYXR1cmVzL2RhdGFzZXRzL0FkZERhdGFzZXQvTGVmdFBhbmVsL2luZGV4LnRzeA==) | `89.47% <ΓΈ> (ΓΈ)` | |
| [superset-frontend/src/features/datasets/styles.ts](https://app.codecov.io/gh/apache/superset/pull/24884?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZlYXR1cmVzL2RhdGFzZXRzL3N0eWxlcy50cw==) | `92.00% <50.00%> (-8.00%)` | :arrow_down: |
| [...uperset-ui-core/src/query/types/AnnotationLayer.ts](https://app.codecov.io/gh/apache/superset/pull/24884?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvcXVlcnkvdHlwZXMvQW5ub3RhdGlvbkxheWVyLnRz) | `100.00% <100.00%> (ΓΈ)` | |
| [...tend/src/features/datasets/DatasetLayout/index.tsx](https://app.codecov.io/gh/apache/superset/pull/24884?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZlYXR1cmVzL2RhdGFzZXRzL0RhdGFzZXRMYXlvdXQvaW5kZXgudHN4) | `100.00% <100.00%> (ΓΈ)` | |
... and [294 files with indirect coverage changes](https://app.codecov.io/gh/apache/superset/pull/24884/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: Weβre building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] eschutho merged pull request #24884: fix: Migration to fix out of sync schema_perm in charts and datasets
Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho merged PR #24884:
URL: https://github.com/apache/superset/pull/24884
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org