PynamoDB
PynamoDB copied to clipboard
batch_get() returns 'NoneType' object is not iterable
OBJECTIVE
The batch_get() function return 'NoneType' object is not iterable ERROR https://github.com/pynamodb/PynamoDB/blob/43a303bea99033348274c3990c6ab71810b76758/pynamodb/models.py#L382
RCA https://github.com/pynamodb/PynamoDB/blob/43a303bea99033348274c3990c6ab71810b76758/pynamodb/models.py#L1026 returns NONE, and assign NONE to https://github.com/pynamodb/PynamoDB/blob/43a303bea99033348274c3990c6ab71810b76758/pynamodb/models.py#L376 which ultimately fails to iterate on NONE. Results to raising 'NoneType' object is not iterable
SOLUTION
Update https://github.com/pynamodb/PynamoDB/blob/43a303bea99033348274c3990c6ab71810b76758/pynamodb/models.py#L382
to
for batch_item in page or []: