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
Expose waiter configuration #1267
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1267 +/- ##
===========================================
+ Coverage 98.04% 98.05% +<.01%
===========================================
Files 45 45
Lines 7382 7389 +7
===========================================
+ Hits 7238 7245 +7
Misses 144 144
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me for the most part. We'll need docs though.
botocore/waiter.py
Outdated
# pop the invocation specific config | ||
config = kwargs.pop('WaiterConfig', {}) | ||
sleep_amount = config.get('delay', self.config.delay) | ||
max_attempts = config.get('maxAttempts', self.config.max_attempts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/maxAttempts/max_attempts/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this to be consistent with the PaginationConfig
formatting. The keys are capitalized words there. The waiter config uses mixed case keys. No matter what the key is called it will break consistency in some way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little picky, but the casing should be pascal casing where the first letter should be capitalized. That is how pagination does it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with MaxAttempts
and Delay
.
Approach looks fine. But I agree with Jordon. We need docs for this. |
It's also worth considering exposing this in the CLI |
Updated to pascal casing and added the docs in a similar manner to pagination. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just had a small comment on the docs. I also think we should add tests for the docs.
botocore/docs/waiter.py
Outdated
waiter_config_members['Delay'] = DocumentedShape( | ||
name='Delay', type_name='integer', | ||
documentation=( | ||
'<p>The amount of time in seconds to wait between attempts.</p>')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is in the top level description, but it might be good to say what the defaults are for Delay
and MaxAttempts
for these operations as well.
Also make sure you add a changelog entity for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Looks good to me. 🚢
Adding so we can properly address aws/aws-cli#2761
This will allow
WaiterConfig
to be passed towaiter.wait()
calls allowing customers to adjust waiter'smaxAttempts
anddelay
settings. This is based on howPaginationConfig
works. The current keys are formatted to match the waiter models.