@@ -25,22 +25,22 @@ con = ibis.hotdata.connect(
2525)
2626
2727# 1. Create a database and declare the tables you'll load
28- con.create_database(" sales" , schema = " public " , tables = [" orders" ])
28+ con.create_database(" sales" , tables = [" orders" ])
2929
3030# 2. Upload a pandas DataFrame (or PyArrow table)
3131df = pd.DataFrame({
3232 " order_id" : [1 , 2 , 3 ],
3333 " amount" : [9.99 , 49.99 , 5.00 ],
3434 " region" : [" west" , " east" , " west" ],
3535})
36- con.create_table(" orders" , df, database = (" sales" , " public " ), overwrite = True )
36+ con.create_table(" orders" , df, database = (" sales" , " main " ), overwrite = True )
3737
3838# 3. Uploads are async — wait briefly before querying
3939time.sleep(2 )
4040
4141# 4. Query with Ibis expressions
4242# Managed tables are always accessed with catalog "default"
43- t = con.table(" orders" , database = (" default" , " public " ))
43+ t = con.table(" orders" , database = (" default" , " main " ))
4444result = (
4545 t.group_by(" region" )
4646 .agg(total = t.amount.sum())
@@ -49,7 +49,7 @@ result = (
4949)
5050
5151# 5. Clean up
52- con.drop_table(" orders" , database = (" sales" , " public " ))
52+ con.drop_table(" orders" , database = (" sales" , " main " ))
5353con.drop_database(" sales" )
5454```
5555
@@ -90,22 +90,22 @@ Managed databases are the primary way to bring data into Hotdata with Ibis. Decl
9090
9191``` python
9292# Declare the database and all table names up front
93- con.create_database(" analytics" , schema = " public " , tables = [" events" , " users" ])
93+ con.create_database(" analytics" , tables = [" events" , " users" ])
9494
9595# Upload from a pandas DataFrame
96- con.create_table(" events" , events_df, database = (" analytics" , " public " ), overwrite = True )
96+ con.create_table(" events" , events_df, database = (" analytics" , " main " ), overwrite = True )
9797
9898# PyArrow tables also work
9999import pyarrow as pa
100100table = pa.table({" id" : [1 , 2 ], " name" : [" alice" , " bob" ]})
101- con.create_table(" users" , table, database = (" analytics" , " public " ), overwrite = True )
101+ con.create_table(" users" , table, database = (" analytics" , " main " ), overwrite = True )
102102
103103# Schema-only (no data): creates an empty table with the declared schema
104104import ibis.expr.schema as sch
105105con.create_table(
106106 " staging" ,
107107 schema = sch.Schema({" id" : " int64" , " ts" : " timestamp" }),
108- database = (" analytics" , " public " ),
108+ database = (" analytics" , " main " ),
109109)
110110```
111111
@@ -116,7 +116,7 @@ Table names must be declared when the database is created — you cannot upload
116116When querying, use ` "default" ` as the catalog:
117117
118118``` python
119- t = con.table(" events" , database = (" default" , " public " ))
119+ t = con.table(" events" , database = (" default" , " main " ))
120120
121121result = (
122122 t.filter(t.event_type == " click" )
@@ -131,7 +131,7 @@ Or with raw SQL:
131131``` python
132132result = con.sql(
133133 ' SELECT user_id, COUNT(*) AS n '
134- ' FROM "default"."public "."events" '
134+ ' FROM "default"."main "."events" '
135135 ' WHERE event_type = \' click\' '
136136 ' GROUP BY user_id'
137137).execute()
@@ -142,8 +142,8 @@ result = con.sql(
142142Pass ` force=True ` to silently skip errors when the database or table does not exist:
143143
144144``` python
145- con.drop_table(" events" , database = (" analytics" , " public " ))
146- con.drop_table(" events" , database = (" analytics" , " public " ), force = True ) # no-op if missing
145+ con.drop_table(" events" , database = (" analytics" , " main " ))
146+ con.drop_table(" events" , database = (" analytics" , " main " ), force = True ) # no-op if missing
147147
148148con.drop_database(" analytics" )
149149con.drop_database(" analytics" , force = True ) # no-op if missing
@@ -161,7 +161,7 @@ con.drop_database("analytics", force=True) # no-op if missing
161161### Ibis expressions
162162
163163``` python
164- t = con.table(" orders" , database = (" default" , " public " ))
164+ t = con.table(" orders" , database = (" default" , " main " ))
165165
166166summary = (
167167 t.filter(t.amount > 10 )
@@ -178,7 +178,7 @@ summary = (
178178
179179``` python
180180base = con.sql(
181- ' SELECT * FROM "default"."public "."orders"' ,
181+ ' SELECT * FROM "default"."main "."orders"' ,
182182 dialect = " postgres" ,
183183)
184184result = base.filter(base.amount > 10 ).execute()
0 commit comments