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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions superset/db_engine_specs/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def upload_to_s3(filename: str, upload_prefix: str, table: Table) -> str:

# pylint: disable=import-outside-toplevel
import boto3
from boto3.s3.transfer import TransferConfig

bucket_path = current_app.config["CSV_TO_HIVE_UPLOAD_S3_BUCKET"]

Expand All @@ -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), # Threading is broken in Python 3.9.
)
return location

Expand Down