kinesis stubber for put_records_batch() does not accept FailedRecordCount == 0
See original GitHub issueDescribe the bug When stubbing like this:
kinesis_stubber.add_response(
'put_records',
expected_params={
'Records': ANY,
'StreamName': ANY
},
service_response={
'FailedRecordCount': 0,
'Records': response_batch
}
)
An error is throw that says FailedRecordCount
can not be 0.
raise ParamValidationError(report=report.generate_report())
E botocore.exceptions.ParamValidationError: Parameter validation failed: E Invalid range for parameter FailedRecordCount, value: 0, valid range: 1-inf
I have verified the actual api call for kinesis client put_records()
does always return a value for FailedRecordCount
and it can indeed be 0.
Steps to reproduce stub a kinesis client call as outlined above.
Expected behavior
The service_response
of the stubbed should accept a value of “0” for FailedRecordCount
Debug logs Full stack trace by adding
'FailedRecordCount' is always returned and it was 0, but stubber says no:
params = {'FailedRecordCount': 0, 'Records': [{'SequenceNumber': 'string', 'ShardId': 'string'}, {'SequenceNumber': 'string', '... 'string'}, {'SequenceNumber': 'string', 'ShardId': 'string'}, {'SequenceNumber': 'string', 'ShardId': 'string'}, ...]}
shape = <StructureShape(PutRecordsOutput)>
def validate_parameters(params, shape):
"""Validates input parameters against a schema.
This is a convenience function that validates parameters against a schema.
You can also instantiate and use the ParamValidator class directly if you
want more control.
If there are any validation errors then a ParamValidationError
will be raised. If there are no validation errors than no exception
is raised and a value of None is returned.
:param params: The user provided input parameters.
:type shape: botocore.model.Shape
:param shape: The schema which the input parameters should
adhere to.
:raise: ParamValidationError
"""
validator = ParamValidator()
report = validator.validate(params, shape)
if report.has_errors():
> raise ParamValidationError(report=report.generate_report())
E botocore.exceptions.ParamValidationError: Parameter validation failed:
E Invalid range for parameter FailedRecordCount, value: 0, valid range: 1-inf
Please let me know if I need to add anymore detail. This is breaking all of our test cases!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
PutRecords - Amazon Kinesis Data Streams Service
Kinesis Data Streams attempts to process all records in each PutRecords request. A single record failure does not stop the processing of subsequent...
Read more >Loading multiple records to Kinesis using PutRecords - how to ...
A record that is successfully added to a stream includes SequenceNumber and ShardId in the result. A record that fails to be added...
Read more >aws kinesis records missing · Issue #1003 - GitHub
I encounter an issue that records lost when called PutRecords api to send data to kinesis. It returns no error when call PutRecords...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Was this issue ever resolved? I seem to be having the same issue.
Any movement on this? This is blocking all of our team’s tests as our code can’t complete when stubbing the response!