Skip to content

Commit

Permalink
fix(snowflake): apply casting logic for json output to scalars (#10202)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored Sep 24, 2024
1 parent abb5593 commit 91764d3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ibis/backends/snowflake/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,9 @@ def convert_column(cls, column: pa.Array, dtype: dt.DataType) -> pa.Array:

return pa.ExtensionArray.from_storage(PYARROW_JSON_TYPE, column)
return super().convert_column(column, dtype)

@classmethod
def convert_scalar(cls, scalar: pa.Scalar, dtype: dt.DataType) -> pa.Scalar:
if dtype.is_json() or dtype.is_array() or dtype.is_map() or dtype.is_struct():
return pa.ExtensionScalar.from_storage(PYARROW_JSON_TYPE, scalar)
return super().convert_scalar(scalar, dtype)

0 comments on commit 91764d3

Please sign in to comment.