Skip to content
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

bug: discover is querying more records than expected #16

Closed
pnadolny13 opened this issue Apr 17, 2023 · 0 comments · Fixed by #18
Closed

bug: discover is querying more records than expected #16

pnadolny13 opened this issue Apr 17, 2023 · 0 comments · Fixed by #18

Comments

@pnadolny13
Copy link
Contributor

The limit kwarg thats used was intended to only query a subset of the table but it looks like the tap logic continues to iterate for more batches instead of breaking.

The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in LastEvaluatedKey to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in LastEvaluatedKey to apply in a subsequent operation to continue the operation. For more information, see Working with Queries in the Amazon DynamoDB Developer Guide.

Potential Solutions:

  • Add an argument to the get_items_iter method
    self, table_name: str, scan_kwargs: dict = {"ConsistentRead": True}
    to break after a certain amount of batches. This way we could send in a limit 100 and batch count = 1 to only return 100 rows.
  • Its possible theres a cleaner way to pass these arguments into the method, consider other solutions.
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 a pull request may close this issue.

1 participant