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

Make botocore.config.Config.{connect,read}_timeout configurable #343

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

k5342
Copy link
Member

@k5342 k5342 commented Aug 27, 2024

Allow users to configure botocore.{connect,read}_timeout in pfio.v2.S3. Support both the ways via the custom scheme or via directly passing the initializer (from_url, pfio.v2.S3) like the below:

a) via the custom scheme

[baz]
scheme = s3
endpoint = https://s3.example.com
aws_access_key_id=hoge
aws_secret_access_key=$HOME
connect_timeout=300
read_timeout=120

b) via the initializer (from_url) ... from a test code

def test_s3_init_with_timeouts(s3_fixture):
    with from_url('s3://test-bucket/base',
                  connect_timeout=300,
                  read_timeout=120) as s3:
        assert isinstance(s3, S3)
        assert (s3.botocore_config['connect_timeout'] == 300)
        assert (s3.botocore_config['read_timeout'] == 120)

@k5342 k5342 added the cat:enhancement Implementation that does not break interfaces. label Aug 27, 2024
@k5342 k5342 changed the title Make botocore.{connect,read}_timeout configurable Make botocore.config.Config.{connect,read}_timeout configurable Aug 27, 2024
Copy link

@sethi0g0 sethi0g0 left a comment

Choose a reason for hiding this comment

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

LGTM :dogeza:

@kuenishi kuenishi added this to the 2.9.0 milestone Aug 27, 2024
@k5342 k5342 merged commit 5b2d41a into master Aug 28, 2024
13 checks passed
@k5342 k5342 deleted the pass-botocore-timeout branch August 28, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:enhancement Implementation that does not break interfaces.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants