From fdf48c63f1220607b9390104b04ba1d9fae7bfcf Mon Sep 17 00:00:00 2001 From: John Bodley <4567245+john-bodley@users.noreply.github.com> Date: Wed, 4 May 2022 08:14:40 -0700 Subject: [PATCH] fix(hive): Workaround for Python 3.9 s3 transfer issue (#19887) * fix(hive): Workaround for Python 3.9 s3 transfer issue * Update hive.py --- superset/db_engine_specs/hive.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/superset/db_engine_specs/hive.py b/superset/db_engine_specs/hive.py index 484e867ab0a88..344d1f7ae9334 100644 --- a/superset/db_engine_specs/hive.py +++ b/superset/db_engine_specs/hive.py @@ -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"] @@ -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