Skip to content

Commit 0ad0ace

Browse files
fix: Ensure that Snowflake accounts for number columns that overspecify precision (#3306)
* fix: Ensure that Snowflake properly accounts for INT32/INT64 columns with default precision 38 type Signed-off-by: Danny Chiao <danny@tecton.ai> * fix: Snowflake infer snowflake OBJECT return type for number inference Signed-off-by: miles.adkins <miles.adkins@snowflake.com> Signed-off-by: Danny Chiao <danny@tecton.ai> Signed-off-by: miles.adkins <miles.adkins@snowflake.com> Co-authored-by: miles.adkins <miles.adkins@snowflake.com>
1 parent 1d288d3 commit 0ad0ace

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sdk/python/feast/infra/offline_stores/snowflake_source.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,16 @@ def get_table_column_names_and_types(
263263
result.dtypes[column].name
264264
]
265265
else:
266+
if len(result) > 0:
267+
max_value = result.iloc[0][0]
268+
if max_value is not None and len(str(max_value)) <= 9:
269+
row["snowflake_type"] = "NUMBER32"
270+
continue
271+
elif (
272+
max_value is not None and len(str(max_value)) <= 18
273+
):
274+
row["snowflake_type"] = "NUMBER64"
275+
continue
266276
raise NotImplementedError(
267277
"NaNs or Numbers larger than INT64 are not supported"
268278
)

0 commit comments

Comments
 (0)