@@ -1653,10 +1653,26 @@ def pa_to_feast_value_type(pa_type_as_str: str) -> ValueType:
16531653
16541654 if pa_type_as_str .startswith ("timestamp" ):
16551655 value_type = ValueType .UNIX_TIMESTAMP
1656+ elif pa_type_as_str .startswith ("date32" ) or pa_type_as_str .startswith ("date64" ):
1657+ # Mirror the DataFrame inference path, which maps "date" to UNIX_TIMESTAMP.
1658+ value_type = ValueType .UNIX_TIMESTAMP
16561659 elif pa_type_as_str .startswith ("map<" ):
16571660 value_type = ValueType .MAP
16581661 elif pa_type_as_str == "large_string" :
16591662 value_type = ValueType .JSON
1663+ elif pa_type_as_str == "large_binary" :
1664+ value_type = ValueType .BYTES
1665+ elif pa_type_as_str == "halffloat" :
1666+ value_type = ValueType .FLOAT
1667+ elif pa_type_as_str .startswith ("decimal128" ) or pa_type_as_str .startswith (
1668+ "decimal256"
1669+ ):
1670+ # Mirror the DataFrame inference path, which maps "decimal" to DECIMAL.
1671+ value_type = ValueType .DECIMAL
1672+ elif pa_type_as_str .startswith ("dictionary<" ):
1673+ # pandas writes "category" columns as Arrow dictionaries; the DataFrame
1674+ # inference path maps "category" to STRING.
1675+ value_type = ValueType .STRING
16601676 elif pa_type_as_str .startswith ("struct<" ) or pa_type_as_str .startswith ("struct{" ):
16611677 value_type = ValueType .STRUCT
16621678 else :
@@ -1683,7 +1699,12 @@ def pa_to_feast_value_type(pa_type_as_str: str) -> ValueType:
16831699 "list<element: bytes>" : ValueType .BYTES_LIST ,
16841700 "list<element: float>" : ValueType .FLOAT_LIST ,
16851701 }
1686- value_type = type_map [pa_type_as_str ]
1702+ value_type = type_map .get (pa_type_as_str )
1703+ if value_type is None :
1704+ raise ValueError (
1705+ f"Feast cannot infer a value type for the Arrow type '{ pa_type_as_str } '. "
1706+ "Declare the feature view schema explicitly, or extend the Arrow type mapping."
1707+ )
16871708
16881709 if is_list :
16891710 value_type = ValueType [value_type .name + "_LIST" ]
0 commit comments