Skip to content

Commit

Permalink
feat: support SchemaLike in Backend.create_table()
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCrews committed Aug 21, 2024
1 parent 198ea83 commit 599256a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ibis/backends/duckdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import torch
from fsspec import AbstractFileSystem

from ibis.expr.schema import SchemaLike


_UDF_INPUT_TYPE_MAPPING = {
InputType.PYARROW: duckdb.functional.ARROW,
Expand Down Expand Up @@ -103,7 +105,7 @@ def create_table(
| pl.LazyFrame
| None = None,
*,
schema: ibis.Schema | None = None,
schema: SchemaLike | None = None,
database: str | None = None,
temp: bool = False,
overwrite: bool = False,
Expand Down Expand Up @@ -147,6 +149,8 @@ def create_table(

if obj is None and schema is None:
raise ValueError("Either `obj` or `schema` must be specified")
if schema is not None:
schema = ibis.schema(schema)

properties = []

Expand Down

0 comments on commit 599256a

Please sign in to comment.