Skip to content

Commit 5992364

Browse files
nanohannohkuepers
andauthored
feat: Improve exception message for unsupported Snowflake data types (#4779)
Improve exception message for unsupported Snowflake data types Signed-off-by: hkuepers <[email protected]> Co-authored-by: hkuepers <[email protected]>
1 parent fa0084f commit 5992364

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,15 @@ def get_table_column_names_and_types(
285285
row["snowflake_type"] = "NUMBERwSCALE"
286286

287287
elif row["type_code"] in [5, 9, 12]:
288-
error = snowflake_unsupported_map[row["type_code"]]
288+
datatype = snowflake_unsupported_map[row["type_code"]]
289289
raise NotImplementedError(
290-
f"The following Snowflake Data Type is not supported: {error}"
290+
f"The datatype of column {row['column_name']} is of type {datatype} in datasource {query}. This type is not supported. Try converting to VARCHAR."
291291
)
292292
elif row["type_code"] in [1, 2, 3, 4, 6, 7, 8, 10, 11, 13]:
293293
row["snowflake_type"] = snowflake_type_code_map[row["type_code"]]
294294
else:
295295
raise NotImplementedError(
296-
f"The following Snowflake Column is not supported: {row['column_name']} (type_code: {row['type_code']})"
296+
f"The datatype of column {row['column_name']} in datasource {query} is not supported."
297297
)
298298

299299
return [
@@ -317,9 +317,9 @@ def get_table_column_names_and_types(
317317
}
318318

319319
snowflake_unsupported_map = {
320-
5: "VARIANT -- Try converting to VARCHAR",
321-
9: "OBJECT -- Try converting to VARCHAR",
322-
12: "TIME -- Try converting to VARCHAR",
320+
5: "VARIANT",
321+
9: "OBJECT",
322+
12: "TIME",
323323
}
324324

325325
python_int_to_snowflake_type_map = {

0 commit comments

Comments
 (0)