-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Running this code hangs for me at await table.exists(), how can i debug this issue ? I can't see any logs
from aiohttp import ClientSession
from aiodynamo.client import Client
from aiodynamo.credentials import Credentials
from aiodynamo.expressions import F
from aiodynamo.http.aiohttp import AIOHTTP
from aiodynamo.models import Throughput, KeySchema, KeySpec, KeyType
from aiodynamo.http.httpx import HTTPX
from dotenv import load_dotenv
load_dotenv()
async def example():
async with ClientSession() as session:
credentials = await Credentials.auto().get_key(http=HTTPX(session))
print(credentials)
print(credentials.secret)
print(credentials.id)
print(credentials.token)
client = Client(AIOHTTP(session), Credentials.auto(), "us-west-2")
print(client.credentials)
table = client.table("any-table")
print("checking if table exists")
does_table_exist = await table.exists()
print("checked if exists=", does_table_exist)
# Create table if it doesn't exist
if not await table.exists():
await table.create(
Throughput(read=10, write=10),
KeySchema(hash_key=KeySpec("key", KeyType.string)),
)
# Create or override an item
await table.put_item({"key": "my-item", "value": 1})
# Get an item
item = await table.get_item({"key": "my-item"})
print(item)
# Update an item, if it exists.
await table.update_item(
{"key": "my-item"}, F("value").add(1), condition=F("key").exists()
)
import asyncio
asyncio.run(example())Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels