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

Require the SQLAlchemy URI on the database model #8720

Merged

Conversation

willbarrett
Copy link
Member

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Currently, attempting to create a database connection without a SQLAlchemy connection string defined will throw a server error (calling strip on NoneType). After the change, the system will reject empty SQLAlchemy connection strings correctly.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@etr2460 @betodealmeida @mistercrunch

@willbarrett willbarrett changed the title Require the SQLAlchemy URI when creating a database Require the SQLAlchemy URI on the database model Dec 3, 2019
@codecov-io
Copy link

codecov-io commented Dec 3, 2019

Codecov Report

Merging #8720 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #8720      +/-   ##
=========================================
- Coverage    65.9%   65.9%   -0.01%     
=========================================
  Files         483     483              
  Lines       24163   24165       +2     
  Branches     2770    2770              
=========================================
  Hits        15925   15925              
- Misses       8060    8062       +2     
  Partials      178     178
Impacted Files Coverage Δ
superset/models/core.py 83.09% <ø> (ø) ⬆️
superset/models/schedules.py 88.88% <0%> (-2.03%) ⬇️
superset/sql_lab.py 77.57% <0%> (-0.47%) ⬇️
superset/views/datasource.py 96.07% <0%> (-0.08%) ⬇️
superset/models/annotations.py 92% <0%> (ø) ⬆️
superset/jinja_context.py 74.73% <0%> (ø) ⬆️
superset/views/sql_lab.py 60.52% <0%> (ø) ⬆️
superset/translations/utils.py 87.5% <0%> (ø) ⬆️
superset/views/log/views.py 100% <0%> (ø) ⬆️
superset/sql_parse.py 96.12% <0%> (ø) ⬆️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c130b3...1aa94dc. Read the comment docs.

Copy link
Member

@john-bodley john-bodley left a comment

Choose a reason for hiding this comment

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

@willbarrett you’ll have to add a Alembic migration as part of this PR since you’re updating the data model.

@willbarrett
Copy link
Member Author

@john-bodley this change was to trigger a UI change in the FAB database UI. I don't feel strongly about adding a NOT NULL constraint at the database level. Do you think such a constraint would be valuable?

@etr2460
Copy link
Member

etr2460 commented Dec 3, 2019

I think we should keep the data model and the database in sync as much as possible here. Also because any generated migration will then try to add this restriction again

@willbarrett
Copy link
Member Author

Works for me. I'll add the migration.

@willbarrett willbarrett force-pushed the wbarrett/sqlalchemy-string-required branch from 0fd1f60 to 1ad9d4e Compare December 10, 2019 20:52
@mistercrunch mistercrunch merged commit ed54f6e into apache:master Dec 11, 2019
@willbarrett willbarrett deleted the wbarrett/sqlalchemy-string-required branch December 11, 2019 23:11
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.36.0 labels Feb 28, 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 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants