Skip to content

Commit

Permalink
Fix OnDemandFeatureView type inference for array types
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Mirrington <alex.mirrington@rokt.com>
  • Loading branch information
alexmirrington committed Jun 24, 2024
1 parent de5b0eb commit 6b7afb9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion sdk/python/feast/transformation/pandas_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def infer_features(self, random_input: dict[str, list[Any]]) -> list[Field]:
Field(
name=f,
dtype=from_value_type(
python_type_to_feast_value_type(f, type_name=str(dt))
python_type_to_feast_value_type(
f, value=output_df[f].tolist()[0], type_name=str(dt)
)
),
)
for f, dt in zip(output_df.columns, output_df.dtypes)
Expand Down
4 changes: 3 additions & 1 deletion sdk/python/feast/transformation/python_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def infer_features(self, random_input: dict[str, list[Any]]) -> list[Field]:
Field(
name=f,
dtype=from_value_type(
python_type_to_feast_value_type(f, type_name=type(dt[0]).__name__)
python_type_to_feast_value_type(
f, value=dt[0], type_name=type(dt[0]).__name__
)
),
)
for f, dt in output_dict.items()
Expand Down
4 changes: 3 additions & 1 deletion sdk/python/feast/transformation/substrait_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def infer_features(self, random_input: dict[str, list[Any]]) -> list[Field]:
Field(
name=f,
dtype=from_value_type(
python_type_to_feast_value_type(f, type_name=str(dt))
python_type_to_feast_value_type(
f, value=output_df[f].tolist()[0], type_name=str(dt)
)
),
)
for f, dt in zip(output_df.columns, output_df.dtypes)
Expand Down

0 comments on commit 6b7afb9

Please sign in to comment.