Skip to content

Commit 6b7afb9

Browse files
Fix OnDemandFeatureView type inference for array types
Signed-off-by: Alex Mirrington <alex.mirrington@rokt.com>
1 parent de5b0eb commit 6b7afb9

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

sdk/python/feast/transformation/pandas_transformation.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def infer_features(self, random_input: dict[str, list[Any]]) -> list[Field]:
4444
Field(
4545
name=f,
4646
dtype=from_value_type(
47-
python_type_to_feast_value_type(f, type_name=str(dt))
47+
python_type_to_feast_value_type(
48+
f, value=output_df[f].tolist()[0], type_name=str(dt)
49+
)
4850
),
4951
)
5052
for f, dt in zip(output_df.columns, output_df.dtypes)

sdk/python/feast/transformation/python_transformation.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def infer_features(self, random_input: dict[str, list[Any]]) -> list[Field]:
4444
Field(
4545
name=f,
4646
dtype=from_value_type(
47-
python_type_to_feast_value_type(f, type_name=type(dt[0]).__name__)
47+
python_type_to_feast_value_type(
48+
f, value=dt[0], type_name=type(dt[0]).__name__
49+
)
4850
),
4951
)
5052
for f, dt in output_dict.items()

sdk/python/feast/transformation/substrait_transformation.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ def infer_features(self, random_input: dict[str, list[Any]]) -> list[Field]:
6464
Field(
6565
name=f,
6666
dtype=from_value_type(
67-
python_type_to_feast_value_type(f, type_name=str(dt))
67+
python_type_to_feast_value_type(
68+
f, value=output_df[f].tolist()[0], type_name=str(dt)
69+
)
6870
),
6971
)
7072
for f, dt in zip(output_df.columns, output_df.dtypes)

0 commit comments

Comments
 (0)