Skip to content

Commit 195e5e7

Browse files
NO SNOW: Fix DecFloat schema nullability when SQL simplifier is disabled (#4239)
Co-authored-by: Jamison Rose <Jamison.Rose@snowflake.com>
1 parent 9cb0c3e commit 195e5e7

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/snowflake/snowpark/_internal/analyzer/datatype_mapper.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,6 @@ def schema_expression(data_type: DataType, is_nullable: bool) -> str:
518518
return "PARSE_JSON('NULL') :: VARIANT"
519519
return "NULL :: " + convert_sp_to_sf_type(data_type)
520520

521-
if isinstance(data_type, DecFloatType):
522-
return "DECFLOAT '0'"
523521
if isinstance(data_type, _NumericType):
524522
return "0 :: " + convert_sp_to_sf_type(data_type)
525523
if isinstance(data_type, StringType):

tests/unit/test_datatype_mapper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ def test_schema_expression():
770770
assert schema_expression(LongType(), False) == "0 :: BIGINT"
771771
assert schema_expression(FloatType(), False) == "0 :: FLOAT"
772772
assert schema_expression(DoubleType(), False) == "0 :: DOUBLE"
773+
assert schema_expression(DecFloatType(), False) == "0 :: DECFLOAT"
773774
assert schema_expression(StringType(), False) == "'a' :: STRING"
774775
assert schema_expression(StringType(19), False) == "'a' :: STRING (19)"
775776
assert schema_expression(BooleanType(), False) == "true"

0 commit comments

Comments
 (0)