Skip to content

Commit 49abaeb

Browse files
committed
update unit tests
1 parent 38bb25a commit 49abaeb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

python/tests/test_catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def create_dataset() -> Table:
5353
names=["a", "b"],
5454
)
5555
dataset = ds.dataset([batch])
56-
return Table.from_dataset(dataset)
56+
return Table(dataset)
5757

5858

5959
class CustomSchemaProvider(dfn.catalog.SchemaProvider):

python/tests/test_context.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,13 @@ def test_deregister_table(ctx, database):
331331
assert public.names() == {"csv1", "csv2"}
332332

333333

334+
def test_register_table_from_dataframe(ctx):
335+
df = ctx.from_pydict({"a": [1, 2]})
336+
ctx.register_table("df_tbl", df)
337+
result = ctx.sql("SELECT * FROM df_tbl").collect()
338+
assert [b.to_pydict() for b in result] == [{"a": [1, 2]}]
339+
340+
334341
def test_register_table_from_dataframe_into_view(ctx):
335342
df = ctx.from_pydict({"a": [1, 2]})
336343
table = df.into_view()

0 commit comments

Comments
 (0)