Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(hive): Fix regression from #21943 #22431

Merged
merged 1 commit into from
Dec 15, 2022
Merged

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Dec 15, 2022

SUMMARY

This PR fixes a regression introduced in #21943 where no context manger was used to create the engine, thus preventing users from being able to upload a CSV file via Hive.

I thought both Pylint would have detected a "Local variable referenced before assignment" error, but maybe the if/context manager logic was simply too complex, as well as the unit tests—but alas this doesn't seem to be the case.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

Tested locally.

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

table=table,
),
)
with cls.get_engine(database) as engine:
Copy link
Member Author

Choose a reason for hiding this comment

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

This line is new. The rest is merely indented.

@john-bodley john-bodley requested review from hughhhh and ktmud December 15, 2022 18:03
@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Merging #22431 (f7afd8b) into master (fa919f3) will decrease coverage by 11.35%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           master   #22431       +/-   ##
===========================================
- Coverage   66.90%   55.54%   -11.36%     
===========================================
  Files        1850     1850               
  Lines       70692    70693        +1     
  Branches     7752     7752               
===========================================
- Hits        47294    39269     -8025     
- Misses      21382    29408     +8026     
  Partials     2016     2016               
Flag Coverage Δ
hive ?
mysql ?
postgres ?
presto 52.36% <0.00%> (-0.01%) ⬇️
python 57.40% <0.00%> (-23.84%) ⬇️
sqlite ?
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/db_engine_specs/hive.py 34.25% <0.00%> (-53.10%) ⬇️
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/tags/core.py 4.54% <0.00%> (-95.46%) ⬇️
superset/key_value/commands/update.py 0.00% <0.00%> (-90.91%) ⬇️
superset/key_value/commands/delete.py 0.00% <0.00%> (-87.88%) ⬇️
superset/db_engines/hive.py 0.00% <0.00%> (-85.19%) ⬇️
superset/key_value/commands/delete_expired.py 0.00% <0.00%> (-84.00%) ⬇️
superset/dashboards/commands/importers/v0.py 15.62% <0.00%> (-76.25%) ⬇️
superset/datasets/commands/create.py 30.61% <0.00%> (-69.39%) ⬇️
superset/datasets/commands/update.py 25.00% <0.00%> (-69.05%) ⬇️
... and 284 more

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

@john-bodley john-bodley requested a review from rusackas December 15, 2022 18:09
@villebro
Copy link
Member

@john-bodley I've run into several problems with mypy lately where it's not picking up trivial typing errors. I wasn't able to look into it more closely, but I did try bumping mypy locally and even enabling all checks, but it still kept glossing over the errors.

@john-bodley john-bodley merged commit 4f9c2c8 into master Dec 15, 2022
john-bodley added a commit to airbnb/superset-fork that referenced this pull request Dec 15, 2022
john-bodley added a commit to airbnb/superset-fork that referenced this pull request Jan 17, 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 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the john-bodley--fix-21943 branch March 26, 2024 16:14
# for free to join this conversation on GitHub. Already have an account? # 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.

4 participants