Skip to content

Commit

Permalink
fix use v4 url for batch-export
Browse files Browse the repository at this point in the history
  • Loading branch information
mfshao committed Feb 18, 2025
1 parent 3210bec commit 67a8614
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions export_job/export_zip_from_manifest_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from gen3.auth import Gen3Auth
import requests
import boto3
from botocore.config import Config

from temporary_api_key import TemporaryAPIKey

Expand Down Expand Up @@ -98,7 +99,7 @@ def upload_export_to_s3(bucket_name, username):
Uploads the local zip export to S3 and returns a presigned URL, expires after 1 hour.
"""

s3_client = boto3.client("s3")
s3_client = boto3.client("s3", config=Config(signature_version='s3v4'))

export_key = f"{quote_plus(username)}-export.zip"
s3_client.upload_file("export.zip", bucket_name, export_key)
Expand Down Expand Up @@ -126,7 +127,7 @@ def fail(error_message=DEFAULT_ERROR_MESSAGE):
try:
bucket_name = os.environ["BUCKET"]
except Exception as e:
print(f"Error: Environment variable 'BUCKET' is not set.")
print("Error: Environment variable 'BUCKET' is not set.")
fail()
try:
input_data = json.loads(os.environ["INPUT_DATA"])
Expand Down

0 comments on commit 67a8614

Please sign in to comment.