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: deal with empty string and None values in s3 endpoint_url #1991

Merged

Conversation

saikonen
Copy link
Collaborator

fixes edge case where setting METAFLOW_S3_ENDPOINT_URL to an empty value would break the new bootstrapping script

@saikonen saikonen requested a review from savingoyal August 26, 2024 19:51
return "{python} -c '{script}'".format(
python=self._python(),
script='import boto3, os; boto3.client(\\"s3\\", endpoint_url=os.getenv(\\"METAFLOW_S3_ENDPOINT_URL\\")).download_file(\\"%s\\", \\"%s\\", \\"job.tar\\")'
script='import boto3, os; ep=os.getenv(\\"METAFLOW_S3_ENDPOINT_URL\\"; (boto3.client(\\"s3\\", endpoint_url=ep) if ep else boto3.client(\\"s3\\")).download_file(\\"%s\\", \\"%s\\", \\"job.tar\\")'
Copy link
Collaborator

Choose a reason for hiding this comment

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

would something like **(ep and {"endpoint_url":ep}) to specify endpoint_url help in reducing the number of chars used here?

@savingoyal savingoyal merged commit cc8ec40 into master Aug 26, 2024
26 checks passed
@savingoyal savingoyal deleted the fix/boto3-bootstrap-script-issue-with-empty-s3-endpoint branch August 26, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants