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(ssh-tunnel): fix dataset creation flow through modal for DB with tunnel #22581

Merged
merged 11 commits into from
Jan 6, 2023

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Jan 3, 2023

SUMMARY

DB's with tunnels are failing to create datasets, put in a fix to use context manager whenever checking on physical tables.

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 Jan 3, 2023

Codecov Report

Merging #22581 (ed83d51) into master (db20180) will increase coverage by 0.01%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master   #22581      +/-   ##
==========================================
+ Coverage   67.00%   67.02%   +0.01%     
==========================================
  Files        1859     1859              
  Lines       71036    71037       +1     
  Branches     7766     7766              
==========================================
+ Hits        47597    47609      +12     
+ Misses      21417    21406      -11     
  Partials     2022     2022              
Flag Coverage Δ
hive 52.47% <66.66%> (+<0.01%) ⬆️
javascript 53.85% <ø> (ø)
mysql 78.01% <66.66%> (?)
postgres 78.09% <66.66%> (+<0.01%) ⬆️
presto 52.37% <66.66%> (+<0.01%) ⬆️
python 81.35% <66.66%> (+0.03%) ⬆️
sqlite 76.46% <66.66%> (+<0.01%) ⬆️
unit 51.47% <33.33%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset/models/core.py 90.49% <66.66%> (+0.66%) ⬆️
superset/views/core.py 74.98% <0.00%> (+0.22%) ⬆️
superset/db_engine_specs/mysql.py 98.80% <0.00%> (+4.76%) ⬆️
superset/common/utils/dataframe_utils.py 95.23% <0.00%> (+4.76%) ⬆️

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

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

@hughhhh I think we should try to avoid this intrusive coding style, this context function has modified too much logic, you should redesign this function.

@hughhhh
Copy link
Member Author

hughhhh commented Jan 4, 2023

@hughhhh I think we should try to avoid this intrusive coding style, this context function has modified too much logic, you should redesign this function.

why do you think it's intrusive?

This pattern is the cleanest way for us to support ssh tunnel in my opinion since we have to build the tunnel within context for any request to query the db

@hughhhh hughhhh changed the title bug(ssh-tunnel): fix dataset creation flow through modal for DB with tunnel fix(ssh-tunnel): fix dataset creation flow through modal for DB with tunnel Jan 4, 2023
Copy link
Member

@Antonio-RiveroMartnez Antonio-RiveroMartnez left a comment

Choose a reason for hiding this comment

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

LGTM!

autoload=True,
autoload_with=self._get_sqla_engine(),
)
with self.get_sqla_engine_with_context() as engine:
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to test this?

@pull-request-size pull-request-size bot added size/M and removed size/S labels Jan 4, 2023
@hughhhh hughhhh force-pushed the fix-dataset-modal-ssh-tunnel branch from 0c81d5d to 26cf408 Compare January 4, 2023 23:17
@hughhhh hughhhh merged commit d18c7d6 into master Jan 6, 2023
@sadpandajoe
Copy link
Member

🏷️ preset:2023.01

sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Jan 6, 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 fix-dataset-modal-ssh-tunnel branch March 26, 2024 16:12
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.

6 participants