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

refactor: pass all properties to validate_parameters #21487

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

eschutho
Copy link
Member

@eschutho eschutho commented Sep 15, 2022

Some databases require values that aren't in the sqlalchemy uri in order to connect. I'm passing in all properties from the validate_params api into the db_engine_spec for validation, instead of just the parameters so that we can continue to keep the client side api structure as similar as possible to the db database model and not have to add the same values in both the root db payload and parameters in order to do validation. This is some pre-work for adding in the databricks form that requires http_path from extras for connection.

Hopefully this change will help clarify the difference between parameters, and when something is a parameter in the db model and when it's not.

I'm also adding the driver to the db model, because as per @betodealmeida's change in #21171 if an engine can have multiple drivers, like databricks, we're going to need to pass that value in from the client side when creating/editing a db in order for us to find the correct db_engine_spec.

TESTING INSTRUCTIONS

Database creation with the new forms should work as expected.

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 #21487 (907e091) into master (4d0c2ba) will decrease coverage by 1.64%.
The diff coverage is 90.00%.

❗ Current head 907e091 differs from pull request most recent head aaeb7a5. Consider uploading reports for the commit aaeb7a5 to get more accurate results

@@            Coverage Diff             @@
##           master   #21487      +/-   ##
==========================================
- Coverage   66.79%   65.15%   -1.65%     
==========================================
  Files        1799     1791       -8     
  Lines       68829    68587     -242     
  Branches     7314     7320       +6     
==========================================
- Hits        45976    44689    -1287     
- Misses      20974    22008    +1034     
- Partials     1879     1890      +11     
Flag Coverage Δ
hive ?
mysql 78.20% <90.00%> (+<0.01%) ⬆️
postgres 78.27% <90.00%> (+<0.01%) ⬆️
presto ?
python 78.40% <90.00%> (-2.96%) ⬇️
sqlite 76.75% <75.00%> (?)
unit ?

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

Impacted Files Coverage Δ
superset/db_engine_specs/snowflake.py 48.34% <50.00%> (-14.75%) ⬇️
superset/db_engine_specs/gsheets.py 46.51% <66.66%> (-29.07%) ⬇️
superset/databases/api.py 95.52% <100.00%> (+0.02%) ⬆️
superset/databases/commands/validate.py 77.58% <100.00%> (ø)
superset/db_engine_specs/base.py 81.46% <100.00%> (-7.87%) ⬇️
superset/db_engine_specs/bigquery.py 73.29% <100.00%> (-8.76%) ⬇️
superset/models/core.py 89.71% <100.00%> (-0.15%) ⬇️
superset/tables/schemas.py 0.00% <0.00%> (-100.00%) ⬇️
superset/columns/schemas.py 0.00% <0.00%> (-100.00%) ⬇️
...-chart-table/src/DataTable/utils/useMountedMemo.ts 0.00% <0.00%> (-87.50%) ⬇️
... and 214 more

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

@eschutho
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

@eschutho Ephemeral environment spinning up at http://34.219.255.3:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@eschutho eschutho mentioned this pull request Sep 23, 2022
9 tasks
Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Awesome!

@jinghua-qa
Copy link
Member

test the db connection form in ephemeral env, LGTM

@eschutho eschutho force-pushed the elizabeth/database_properties branch from 87cd1ce to 986471e Compare October 3, 2022 19:55
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2022

Ephemeral environment shutdown and build artifacts deleted.

hughhhh pushed a commit to preset-io/superset that referenced this pull request Oct 7, 2022
@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/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants