1

I am trying to batch-write a list of items into a database using code sample from here

Here's a code excerpt from my script:

import boto

conn = boto.connect_dynamodb(...)
main_table = conn.get_table(...)

do_batch_write(items,conn,main_table)

def do_batch_write(items,conn,table):
       batch_list = conn.new_batch_write_list()

At the last line, I am getting the following exception:

'Layer2' object has no attribute 'new_batch_write_list'

Why? I seem to be doing exactly what's in the sample under the above link. Thanks!

I Z
  • 5,719
  • 19
  • 53
  • 100
  • Are you sure the first functions worked? If you don't have IAM permissions to list all tables, boto refuses to `get_table`, for example. – Dave Mar 25 '13 at 20:25

1 Answers1

0

What version of boto are you using? The example you link to seems to work for me. To find out which version you are running, try starting up an interactive Python session and do this:

>>> import boto
>>> boto.__version__
'2.8.0-dev'
>>>

What does yours say?

garnaat
  • 44,310
  • 7
  • 123
  • 103
  • 1
    It's 2.2.2 which probably explains the issue. I am running boto on an AWS EC2 instance. What would be the best way to update boto to a newer version? Thx – I Z Mar 25 '13 at 20:29
  • 1
    Well, `sudo pip install -U boto` seems to have worked. That is, I am getting a different exception now. :-) But that's another matter... – I Z Mar 25 '13 at 20:45