-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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: Fix Uniqueness check before update for Sqllab Overwrites #16859
Conversation
5279de7
to
6103252
Compare
6103252
to
f6c30fc
Compare
27c19df
to
956b2e6
Compare
Codecov Report
@@ Coverage Diff @@
## master #16859 +/- ##
==========================================
+ Coverage 77.05% 77.16% +0.11%
==========================================
Files 1021 1021
Lines 54693 56341 +1648
Branches 7457 7679 +222
==========================================
+ Hits 42141 43475 +1334
- Misses 12307 12618 +311
- Partials 245 248 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
superset/connectors/sqla/models.py
Outdated
@@ -1662,9 +1663,9 @@ def before_update( | |||
|
|||
# Check whether the relevant attributes have changed. | |||
state = db.inspect(target) # pylint: disable=no-member | |||
|
|||
for attr in ["database_id", "schema", "table_name"]: | |||
for attr in ["schema", "table_name"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't remove database_id
here, otherwise someone might create a dataset with the same database ID, schema and table name. We should figure out why database ID is coming as null when updating.
956b2e6
to
08d2a94
Compare
db851ed
to
0fc7454
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple questions.
9c9dbd1
to
8f49122
Compare
8f49122
to
68c8d3c
Compare
…#16859) * add condition to make sure columns are available before throwing * fix * remove database_id from history changed * refactor update call to datasets * cleanup * oops * prettier
…#16859) * add condition to make sure columns are available before throwing * fix * remove database_id from history changed * refactor update call to datasets * cleanup * oops * prettier
SUMMARY
Inside the
before_update
event listener whenever a user would overwrite a dataset from sqllab we'd get'committed_state': {'database_id': symbol('NO_VALUE')},
. This is causing update (PUT) request to fail in sqllab to fix this we've updated the network call to not includedatabase_id
since it isn't mandatory.Also did a small refactor to remove
src/api/datasets.ts
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION