Skip to content

Commit

Permalink
chore: allow nullability to be passed in to to_ibis
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Sep 13, 2024
1 parent d383eab commit dc5d4aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ibis/backends/sql/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ def to_ibis(cls, typ: sge.DataType, nullable: bool | None = None) -> dt.DataType
)
typecode = typ.this

nullable = typ.args.get("nullable", cls.default_nullable)
nullable = typ.args.get(
"nullable", nullable if nullable is not None else cls.default_nullable
)
if method := getattr(cls, f"_from_sqlglot_{typecode.name}", None):
dtype = method(*typ.expressions, nullable=nullable)
elif (known_typ := _from_sqlglot_types.get(typecode)) is not None:
Expand Down

0 comments on commit dc5d4aa

Please sign in to comment.