question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

not getting record returned from boto3 dynamoDB scan

See original GitHub issue

I am using boto3 to scan a DynamoDB table to find records with a certain ID (articleID or imageID).

For some valid articleIDs the scan returns zero results. If I do the scan with the exact same articleID in the DynamoDB console, it works fine. Through boto3, zero results. If I pick another articleID, the results return as expected.

For the records that don’t return, it also won’t return using the imageID. For the record that does work, it works for either ID. I can’t see any difference between the records. The only thing I can think of is that the ones that don’t work time out, but is there a setting for that in boto3?

Table name articleImages Primary partition key imageID (String) Primary sort key articleID (String)

db = boto3.resource('dynamodb')
imageTable = db.Table('articleImages')
articleID = "Xxp6ntkoUnX4NDEqn8gSVo" #THIS DOESNT WORK HERE BUT DOES IN CONSOLE
articleID = "EqVxu2tcP7EavFGPDw7R5A" # THIS ONE WORKS HERE
response = imageTable.scan(
FilterExpression=Attr('articleID').eq(articleID)
)

thanks in advance

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
robertchencommented, Sep 7, 2018

Limit=1000 does not work, have to do pagination or create an index for query

0reactions
harshgangwarcommented, Nov 29, 2019

One solution using paginator, You can take reference from there: https://stackoverflow.com/questions/36780856/complete-scan-of-dynamodb-with-boto3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Your DynamoDB Scan or Query Is Not Returning All Your ...
When your Scan or Query exceeds 1MB worth of data, only a single 'page' of items will be returned. Again, the exact quantity...
Read more >
python DynamoDB scan operation not return all records
DynamoDB only returns 1MB per request. You have to loop through and make multiple requests until you get your entire dataset.
Read more >
[Solved] dynamodb query not returning the full item - Dynobase
If you are querying a GSI of a table, you will only get the attributes you project onto the index. It may cause...
Read more >
DynamoDB — Boto3 Docs 1.26.34 documentation - AWS
Amazon DynamoDB is a fully managed NoSQL database service that provides fast and ... If a requested item does not exist, it is...
Read more >
Best practices for querying and scanning data
The problem is not just the sudden increase in capacity units that the Scan uses. The scan is also likely to consume all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found