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

Use full s3 URL for ConnectionTimeoutError #60

Merged

Conversation

dcjohnson24
Copy link
Collaborator

Description

Line 235 of compare_scheduled_and_rt.py throws a botocore.exceptions.ConnectionTimeoutError or a botocore.exceptions.EndpointConnectionError. Using the s3 URL gets around this problem.

Resolves #59

Type of change

  • Bug fix
  • New functionality
  • Documentation

How has this been tested?

Locally

@dcjohnson24 dcjohnson24 changed the title Use full s3 URL for connection timeout errors Use full s3 URL for ConnectionTimeoutError May 15, 2023
try:
df = pd.read_csv(filename.as_uri(), low_memory=False)
except (botocore.exceptions.ConnectTimeoutError, botocore.exceptions.EndpointConnectionError):
s3_filename = '/'.join(filename.parts[-2:])
Copy link
Collaborator

Choose a reason for hiding this comment

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

@dcjohnson24 This may be a dumb question, but why don't we try the f'https://{csrt.BUCKET_PUBLIC}.s3.us-east-2.amazonaws.com/{s3_... approach the first time around if the pd.read_csv(filename.as_uri(), low_memory=False) may throw an error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for catching this. You're right that it would probably work to just use the f'https://{csrt.BUCKET_PUBLIC}.s3.us-east-2.amazonaws.com/{s3_... approach.

@dcjohnson24 dcjohnson24 merged commit b51491b into chihacknight:main Jan 15, 2024
@dcjohnson24 dcjohnson24 deleted the connection-timeout-workaround branch January 15, 2024 00:01
haileyplusplus pushed a commit to haileyplusplus/chn-ghost-buses that referenced this pull request Apr 1, 2024
…t-workaround

Use full s3 URL for ConnectionTimeoutError
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.

[Data] ConnectionTimeoutError
3 participants