Skip to content

Commit cff3959

Browse files
authored
Redshift - avoid extra cleanup on UNLOAD (#935)
1 parent 52f82a8 commit cff3959

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

awswrangler/redshift.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,6 @@ def unload_to_files(
864864
max_file_size: Optional[float] = None,
865865
kms_key_id: Optional[str] = None,
866866
manifest: bool = False,
867-
use_threads: bool = True,
868867
partition_cols: Optional[List[str]] = None,
869868
boto3_session: Optional[boto3.Session] = None,
870869
) -> None:
@@ -910,9 +909,6 @@ def unload_to_files(
910909
kms_key_id : str, optional
911910
Specifies the key ID for an AWS Key Management Service (AWS KMS) key to be
912911
used to encrypt data files on Amazon S3.
913-
use_threads : bool
914-
True to enable concurrent requests, False to disable multiple threads.
915-
If enabled os.cpu_count() will be used as the max number of threads.
916912
manifest : bool
917913
Unload a manifest file on S3.
918914
partition_cols: List[str], optional
@@ -941,7 +937,6 @@ def unload_to_files(
941937
if unload_format not in [None, "CSV", "PARQUET"]:
942938
raise exceptions.InvalidArgumentValue("<unload_format> argument must be 'CSV' or 'PARQUET'")
943939
session: boto3.Session = _utils.ensure_session(session=boto3_session)
944-
s3.delete_objects(path=path, use_threads=use_threads, boto3_session=session)
945940
with con.cursor() as cursor:
946941
format_str: str = unload_format or "PARQUET"
947942
partition_str: str = f"\nPARTITION BY ({','.join(partition_cols)})" if partition_cols else ""
@@ -955,7 +950,7 @@ def unload_to_files(
955950
aws_access_key_id=aws_access_key_id,
956951
aws_secret_access_key=aws_secret_access_key,
957952
aws_session_token=aws_session_token,
958-
boto3_session=boto3_session,
953+
boto3_session=session,
959954
)
960955

961956
sql = (
@@ -1106,7 +1101,6 @@ def unload(
11061101
max_file_size=max_file_size,
11071102
kms_key_id=kms_key_id,
11081103
manifest=False,
1109-
use_threads=use_threads,
11101104
boto3_session=session,
11111105
)
11121106
if chunked is False:

0 commit comments

Comments
 (0)