Skip to content

Commit 91764d3

Browse files
authored
fix(snowflake): apply casting logic for json output to scalars (#10202)
1 parent abb5593 commit 91764d3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ibis/backends/snowflake/converter.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,9 @@ def convert_column(cls, column: pa.Array, dtype: dt.DataType) -> pa.Array:
9797

9898
return pa.ExtensionArray.from_storage(PYARROW_JSON_TYPE, column)
9999
return super().convert_column(column, dtype)
100+
101+
@classmethod
102+
def convert_scalar(cls, scalar: pa.Scalar, dtype: dt.DataType) -> pa.Scalar:
103+
if dtype.is_json() or dtype.is_array() or dtype.is_map() or dtype.is_struct():
104+
return pa.ExtensionScalar.from_storage(PYARROW_JSON_TYPE, scalar)
105+
return super().convert_scalar(scalar, dtype)

0 commit comments

Comments
 (0)