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(ssh-tunnel): Refactor establishing raw connection with contextmanger #22366

Merged
merged 13 commits into from
Dec 29, 2022

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Dec 7, 2022

SUMMARY

Refactoring how we instantiate raw connections with the new @contextmanager pattern for instantiating sqlalchemy engines. With this PR, we can do the samething but with raw connections within the engine. Instead of instantiating the 2 contextmangers to get access to the connections users of this functions will only have make one call to get the proper context.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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 Dec 7, 2022

Codecov Report

Merging #22366 (1e1b34c) into master (b6d39d1) will increase coverage by 0.00%.
The diff coverage is 81.42%.

@@           Coverage Diff           @@
##           master   #22366   +/-   ##
=======================================
  Coverage   66.91%   66.91%           
=======================================
  Files        1851     1851           
  Lines       70715    70709    -6     
  Branches     7766     7766           
=======================================
- Hits        47320    47316    -4     
+ Misses      21373    21371    -2     
  Partials     2022     2022           
Flag Coverage Δ
hive 52.46% <62.85%> (+<0.01%) ⬆️
javascript 53.85% <ø> (ø)
mysql 77.95% <81.42%> (+<0.01%) ⬆️
postgres 78.03% <81.42%> (+<0.01%) ⬆️
presto 52.36% <62.85%> (+<0.01%) ⬆️
python 81.27% <81.42%> (+<0.01%) ⬆️
sqlite 76.49% <81.42%> (+<0.01%) ⬆️
unit 51.19% <2.85%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/db_engine_specs/base.py 89.25% <0.00%> (+0.12%) ⬆️
superset/db_engine_specs/gsheets.py 76.29% <0.00%> (+0.38%) ⬆️
superset/sql_validators/presto_db.py 82.43% <ø> (ø)
superset/sql_lab.py 81.13% <85.71%> (-0.08%) ⬇️
superset/connectors/sqla/utils.py 89.00% <100.00%> (-0.33%) ⬇️
superset/db_engine_specs/presto.py 88.02% <100.00%> (-0.08%) ⬇️
superset/models/core.py 90.61% <100.00%> (+0.10%) ⬆️

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

@betodealmeida
Copy link
Member

@hughhhh would you mind adding at least a summary to the PR?

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.

Nice refactoring, it's a good clean up!

Let's just add a summary so that anyone who revisits this PR in the future has some context.

@hughhhh hughhhh merged commit 9c0d6c5 into master Dec 29, 2022
john-bodley pushed a commit to airbnb/superset-fork that referenced this pull request Jan 24, 2023
@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 refactor-tc branch March 26, 2024 16:19
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.

3 participants