import pyarrow as pa
import geneva
db = geneva.connect(CLOUD_OBJECT_STORAGE_LOCATION)
# Create a raw product table
schema = pa.schema([
pa.field("product_id", pa.int64()),
pa.field("title", pa.string()),
pa.field("description", pa.string()),
pa.field("category", pa.string()),
pa.field("price", pa.float64()),
])
data = pa.table({
"product_id": [1, 2, 3, 4, 5],
"title": ["Chainmail Coif", "Jousting Lance Grip Tape", "Dragon-Repellent Spray", "Sword Squeegee", "Visor Windshield Wipers"],
"description": [
"Premium riveted chainmail head covering. Breathable enough for dragon fire, probably.",
"Non-slip grip tape for jousting lances. 3000 PSI tensile strength. Void where tilting is prohibited.",
"All-natural herbal spray. Dragons hate it. Effectiveness not guaranteed against actual dragons.",
"Ergonomic squeegee fits all standard broadswords. Removes blood, mud, and existential dread.",
"Hand-cranked windshield wipers for full-face visors. Never ride blind into battle again.",
],
"category": ["armor", "tournament", "defense", "maintenance", "armor"],
"price": [129.99, 45.00, 59.99, 34.99, 24.99],
})
try:
db.drop_table("products_raw")
except Exception:
pass
table = db.create_table("products_raw", data=data, schema=schema)