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-api): allow undefined schema in post #24242

Merged
merged 1 commit into from
May 30, 2023

Conversation

villebro
Copy link
Member

@villebro villebro commented May 29, 2023

SUMMARY

The POST schema in the datasets API didn't accept None values, unlike the other schemas (check e.g. PUT here:

schema = fields.String(allow_none=True, validate=Length(0, 255))
)

BEFORE

Previously saving a dataset with an undefined schema caused an error:
image

TESTING INSTRUCTIONS

  1. Go to SQL Lab, choose a db but don't select a schema
  2. Write a query, create a chart, and try to save as a dataset
  3. Get error

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 May 29, 2023

Codecov Report

Merging #24242 (6752df4) into master (50535e4) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 6752df4 differs from pull request most recent head 2373881. Consider uploading reports for the commit 2373881 to get more accurate results

@@           Coverage Diff           @@
##           master   #24242   +/-   ##
=======================================
  Coverage   68.30%   68.30%           
=======================================
  Files        1957     1957           
  Lines       75594    75594           
  Branches     8224     8224           
=======================================
  Hits        51637    51637           
  Misses      21849    21849           
  Partials     2108     2108           
Flag Coverage Δ
hive 53.36% <100.00%> (ø)
mysql 78.91% <100.00%> (ø)
postgres 78.99% <100.00%> (ø)
presto 53.29% <100.00%> (ø)
python 82.81% <100.00%> (ø)
sqlite 77.53% <100.00%> (ø)
unit 53.42% <100.00%> (ø)

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

Impacted Files Coverage Δ
superset/datasets/schemas.py 97.48% <100.00%> (ø)

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

@@ -530,7 +530,7 @@ def test_create_dataset_item(self):
self.login(username="admin")
table_data = {
"database": main_db.id,
"schema": "",
"schema": None,
Copy link
Member Author

Choose a reason for hiding this comment

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

All the other tests have "", so I figured changing just one of these to None should be sufficient (no point in adding a full test for this)

@villebro villebro requested a review from dpgaspar May 29, 2023 11:06
Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

LGTM

@villebro villebro merged commit 8375baa into apache:master May 30, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 8, 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/XS 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants