Skip to content

feat: allow setting or unsetting the boto retry configuration #1271

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryancausey
Copy link
Contributor

@ryancausey ryancausey commented May 21, 2025

feat: allow setting or unsetting the boto retry configuration

This adds the ability to directly set the boto retry configuration
dictionary, or to leave it unset and allow botocore to automatically
discover the configuration from the environment or ~/.aws/config
files.

The default is to use the previous PynamoDB behavior for configuring
retries so as to not make this a breaking change.

Closes #1268

@ryancausey
Copy link
Contributor Author

@ikonst this is my first attempt at adding this feature. I wanted to check that this was in line with what we discussed in #1268 before polishing and adding tests. Please review and let me know, thanks!

@ryancausey ryancausey force-pushed the feat/add-boto-compatible-retry-configuration branch from 6ac73a6 to 1fb386b Compare May 21, 2025 05:16
@ryancausey ryancausey force-pushed the feat/add-boto-compatible-retry-configuration branch from 1fb386b to 8705eb6 Compare May 21, 2025 05:21
@ryancausey
Copy link
Contributor Author

The good news is this change works locally for me and confirms that botocore is handling the AWS SDK configuration discovery logic, not boto3. I was able to override the setting to be None and it automatically picked up the retry configuration values in my ~/.aws/config file.

@ryancausey ryancausey force-pushed the feat/add-boto-compatible-retry-configuration branch from 8705eb6 to a741b8d Compare May 23, 2025 23:40
@ryancausey ryancausey force-pushed the feat/add-boto-compatible-retry-configuration branch from a741b8d to 64b9ee2 Compare May 23, 2025 23:44
Copy link
Contributor

@ikonst ikonst left a comment

Choose a reason for hiding this comment

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

Let's see where we should document this.

@ryancausey
Copy link
Contributor Author

I'm going to try and finish adding tests and docs today. If there's a specific place besides the settings docs this should be mentioned, let me know.

@ryancausey ryancausey force-pushed the feat/add-boto-compatible-retry-configuration branch from 64b9ee2 to 5cc0d26 Compare May 24, 2025 20:53
@ryancausey ryancausey changed the title DRAFT feat: allow setting or unsetting the boto retry configuration feat: allow setting or unsetting the boto retry configuration May 24, 2025
@ryancausey ryancausey marked this pull request as ready for review May 24, 2025 20:53
@ryancausey ryancausey force-pushed the feat/add-boto-compatible-retry-configuration branch from 5cc0d26 to ecf6987 Compare May 24, 2025 20:55
This adds the ability to directly set the boto retry configuration
dictionary, or to leave it unset and allow botocore to automatically
discover the configuration from the environment or `~/.aws/config`
files.

The default is to use the previous PynamoDB behavior for configuring
retries so as to not make this a breaking change.
@ryancausey ryancausey force-pushed the feat/add-boto-compatible-retry-configuration branch from ecf6987 to 3898f90 Compare May 24, 2025 20:56
@ryancausey ryancausey requested a review from ikonst May 24, 2025 20:59
@ryancausey
Copy link
Contributor Author

@ikonst I made some updates and added tests and docs. Please re-review. Please note the changes to Connection.__init__ that allow for direct users of the Connection class to leave the botocore retry configuration unset. I couldn't just pass through None since that has been used to indicate "pull this config value from the settings file".

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.

Does PynamoDB support Boto3's various retry modes?
2 participants