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.

DynamoDB docs mention xrange

See original GitHub issue

Describe the bug A clear and concise description of what the bug is.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb.html#DynamoDB.Table.batch_writer has as an example:

with table.batch_writer() as batch:
    for _ in xrange(1000000):
        batch.put_item(Item={'HashKey': '...',
                             'Otherstuff': '...'})
    # You can also delete_items in a batch.
    batch.delete_item(Key={'HashKey': 'SomeHashKey'})

Steps to reproduce If you have a runnable example, please include it as a snippet or link to a repository/gist for larger code examples.

Expected behavior A clear and concise description of what you expected to happen.

xrange is available in python3 as range. Since support for python2 will soon be dropped, it might make sense to change that to range.

Debug logs Full stack trace by adding boto3.set_stream_logger('') to your code.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
BastianZimcommented, May 17, 2021

Awesome, thanks for investigating this @stobrien89!

PR is at #2872

1reaction
stobrien89commented, May 17, 2021

Hi @BastianZim,

So I had another look at it on Friday and it turns out I forgot to reinstall boto3 after I made my changes— this does in fact live in the file referenced above. You can go ahead and submit a PR if you’d like!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with items and attributes - Amazon DynamoDB
In Amazon DynamoDB, an item is a collection of attributes. Each attribute has a name and a value. An attribute value can be...
Read more >
DynamoDB — Boto3 Docs 1.26.34 documentation - AWS
Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability.
Read more >
What is Hash and Range Primary Key? - Stack Overflow
"Hash and Range Primary Key" means that a single row in DynamoDB has a unique primary key made up of both the hash...
Read more >
Migrate from DynamoDB to Cloud Spanner
For a production deployment, refer to the documentation for Spanner instances to determine the appropriate compute capacity to meet your database ...
Read more >
aws_dynamodb_table | Resources | hashicorp/aws
Example Usage. Basic Example. The following dynamodb table description models the table and GSI shown in the AWS SDK example documentation resource " ......
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