Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Devin feedback
Signed-off-by: Nick Quinn <nicholas_quinn@apple.com>
  • Loading branch information
nickquinn408 committed Apr 5, 2026
commit 1c19b7f9cd472ce0b29a21273dd3f77be82223a0
6 changes: 6 additions & 0 deletions sdk/python/feast/type_map.py
Comment thread
nquinn408 marked this conversation as resolved.
Comment thread
nquinn408 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,9 @@ def _convert_value_name_to_snowflake_udf(value_name: str, project_name: str) ->
"TIME_UUID_LIST": f"feast_{project_name}_snowflake_array_varchar_to_list_string_proto",
"UUID_SET": f"feast_{project_name}_snowflake_array_varchar_to_list_string_proto",
"TIME_UUID_SET": f"feast_{project_name}_snowflake_array_varchar_to_list_string_proto",
"DECIMAL": f"feast_{project_name}_snowflake_varchar_to_string_proto",
"DECIMAL_LIST": f"feast_{project_name}_snowflake_array_varchar_to_list_string_proto",
"DECIMAL_SET": f"feast_{project_name}_snowflake_array_varchar_to_list_string_proto",
}
return name_map[value_name].upper()

Expand Down Expand Up @@ -1830,6 +1833,9 @@ def feast_value_type_to_pa(
ValueType.TIME_UUID_LIST: pyarrow.list_(pyarrow.string()),
ValueType.UUID_SET: pyarrow.list_(pyarrow.string()),
ValueType.TIME_UUID_SET: pyarrow.list_(pyarrow.string()),
ValueType.DECIMAL: pyarrow.string(),
ValueType.DECIMAL_LIST: pyarrow.list_(pyarrow.string()),
ValueType.DECIMAL_SET: pyarrow.list_(pyarrow.string()),
}
return type_map[feast_type]

Expand Down
29 changes: 29 additions & 0 deletions sdk/python/tests/unit/test_type_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,35 @@ def test_decimal_pandas_type(self):

assert feast_value_type_to_pandas_type(ValueType.DECIMAL) == "object"

def test_decimal_pyarrow_type(self):
"""feast_value_type_to_pa returns pyarrow.string() for DECIMAL scalar/list/set."""
import pyarrow

from feast.type_map import feast_value_type_to_pa

assert feast_value_type_to_pa(ValueType.DECIMAL) == pyarrow.string()
assert feast_value_type_to_pa(ValueType.DECIMAL_LIST) == pyarrow.list_(
pyarrow.string()
)
assert feast_value_type_to_pa(ValueType.DECIMAL_SET) == pyarrow.list_(
pyarrow.string()
)

def test_decimal_snowflake_udf(self):
"""_convert_value_name_to_snowflake_udf maps DECIMAL types to varchar UDFs."""
from feast.type_map import _convert_value_name_to_snowflake_udf

project = "myproject"
assert _convert_value_name_to_snowflake_udf("DECIMAL", project) == (
f"FEAST_{project.upper()}_SNOWFLAKE_VARCHAR_TO_STRING_PROTO"
)
assert _convert_value_name_to_snowflake_udf("DECIMAL_LIST", project) == (
f"FEAST_{project.upper()}_SNOWFLAKE_ARRAY_VARCHAR_TO_LIST_STRING_PROTO"
)
assert _convert_value_name_to_snowflake_udf("DECIMAL_SET", project) == (
f"FEAST_{project.upper()}_SNOWFLAKE_ARRAY_VARCHAR_TO_LIST_STRING_PROTO"
)


class TestNestedCollectionTypes:
"""Tests for nested collection type proto conversion (VALUE_LIST, VALUE_SET)."""
Expand Down
Loading