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(hive): Workaround for Python 3.9 s3 transfer issue #19887

Merged
merged 2 commits into from
May 4, 2022

Conversation

john-bodley
Copy link
Member

SUMMARY

This PR remedies an issue we (Airbnb) were facing after upgrading to Python 3.9. Per boto/s3transfer#197 (comment) there seems to be an s3 threading with Python 3.9+ causing the transfer to fail. Disabling threading seems to mitigate the issue. Note it's unclear what the potential performance impact is, especially when uploading large files.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI and verified within an Airbnb environment.

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 Apr 28, 2022

Codecov Report

Merging #19887 (56742ed) into master (ea6753d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 56742ed differs from pull request most recent head 884ac20. Consider uploading reports for the commit 884ac20 to get more accurate results

@@           Coverage Diff           @@
##           master   #19887   +/-   ##
=======================================
  Coverage   66.52%   66.52%           
=======================================
  Files        1714     1714           
  Lines       65032    65033    +1     
  Branches     6717     6717           
=======================================
+ Hits        43260    43261    +1     
  Misses      20065    20065           
  Partials     1707     1707           
Flag Coverage Δ
hive 52.91% <0.00%> (-0.01%) ⬇️
javascript 51.25% <ø> (ø)
mysql 81.92% <100.00%> (+<0.01%) ⬆️
postgres 81.96% <100.00%> (+<0.01%) ⬆️
presto 52.76% <0.00%> (-0.01%) ⬇️
python 82.39% <100.00%> (+<0.01%) ⬆️
sqlite 81.73% <100.00%> (+<0.01%) ⬆️
unit 47.99% <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 85.87% <100.00%> (+0.05%) ⬆️

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 ea6753d...884ac20. Read the comment docs.

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

one suggestion, lgtm otherwise

@@ -80,6 +81,7 @@ def upload_to_s3(filename: str, upload_prefix: str, table: Table) -> str:
filename,
bucket_path,
os.path.join(upload_prefix, table.table, os.path.basename(filename)),
Config=TransferConfig(use_threads=False),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Config=TransferConfig(use_threads=False),
# Disabling threading because it breaks python 3.9
Config=TransferConfig(use_threads=False),

Copy link
Member Author

Choose a reason for hiding this comment

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

@etr2460 I inlined the comment.

@john-bodley john-bodley merged commit fdf48c6 into master May 4, 2022
jasonvank pushed a commit to CarbonEdge2021/superset that referenced this pull request May 4, 2022
* fix(hive): Workaround for Python 3.9 s3 transfer issue

* Update hive.py
jasonvank pushed a commit to CarbonEdge2021/superset that referenced this pull request May 4, 2022
* fix(hive): Workaround for Python 3.9 s3 transfer issue

* Update hive.py
hughhhh pushed a commit to hve-labs/superset that referenced this pull request May 11, 2022
* fix(hive): Workaround for Python 3.9 s3 transfer issue

* Update hive.py
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
* fix(hive): Workaround for Python 3.9 s3 transfer issue

* Update hive.py
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the john-bodley--hive-upload_to_s3 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/XS 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants