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

chore(tags): Refactor logic to leverage Flask-SQLAlchemy extension #21459

Merged
merged 6 commits into from
Oct 3, 2022

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Sep 13, 2022

SUMMARY

Rather than passing in the engine—which isn't apparent whether it refers to an external engine or Superset's metadata engine—when managing tags, this PR simply leverages the Flask-SQLAlchemy extension directly.

Note it's not overly clear whether we should use db.engine.execute(...) or db.session.execute(...), though per here it seems like the later is preferred when using the ORM functionality (as opposed to raw SQL).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI.

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

@john-bodley john-bodley changed the title John bodley tags use db session chore(tags): Refactor logic to leverage Flask-SQLAlchemy extension Sep 13, 2022
@codecov
Copy link

codecov bot commented Sep 13, 2022

Codecov Report

Merging #21459 (e27006b) into master (8d1b7ec) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           master   #21459   +/-   ##
=======================================
  Coverage   66.82%   66.82%           
=======================================
  Files        1799     1799           
  Lines       68831    68830    -1     
  Branches     7332     7332           
=======================================
  Hits        45997    45997           
+ Misses      20954    20953    -1     
  Partials     1880     1880           
Flag Coverage Δ
hive 52.89% <0.00%> (+<0.01%) ⬆️
javascript 53.15% <ø> (ø)
mysql 78.21% <0.00%> (+<0.01%) ⬆️
postgres 78.27% <0.00%> (+<0.01%) ⬆️
presto 52.79% <0.00%> (+<0.01%) ⬆️
python 81.42% <0.00%> (+<0.01%) ⬆️
sqlite 76.77% <0.00%> (+<0.01%) ⬆️
unit 50.92% <0.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/cli/update.py 0.00% <0.00%> (ø)
superset/common/tags.py 0.00% <0.00%> (ø)

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

@john-bodley john-bodley marked this pull request as ready for review September 14, 2022 22:44
@john-bodley john-bodley merged commit 31895f4 into master Oct 3, 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
@mistercrunch mistercrunch deleted the john-bodley--tags-use-db-session branch March 26, 2024 16:14
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/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants