Skip to content

Instantly share code, notes, and snippets.

@yasudacloud
Created April 7, 2023 13:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
con = Connection(region='ap-northeast-1', host="http://localhost:8000")
now = datetime.now()
sample1 = Sample(sample_id='1001', text='hello1', created=now)
sample2 = Sample(sample_id='1002', text='hello2', created=now)
try:
with TransactWrite(connection=con) as transaction:
transaction.save(sample1)
transaction.save(sample2)
except TransactWriteError as e:
print(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment