Skip to content

Add support for singleton Dictionary execution for on demand feature views #4075

@franciscojavierarceo

Description

@franciscojavierarceo

Is your feature request related to a problem? Please describe.
Support for Python Native transformations was recently released (#4069) but it expects a type = Dict[str, List[Any]]. Feast should support Dict[str, Any] where Any could be a singleton.

Describe the solution you'd like
We should be able to run on demand feature views like so:

@on_demand_feature_view(
    sources=[driver_stats_fv[["conv_rate", "acc_rate"]]],
    schema=[
        Field(name="conv_rate_plus_acc_python_singleton", dtype=Float64)
    ],
    mode="python",
)
def python_singleton_view(inputs: Dict[str, Any]) -> Dict[str, Any]:
    output: Dict[str, Any] = dict(conv_rate_plus_acc_python=float("-inf"))
    output["conv_rate_plus_acc_python_singleton"] = (
        inputs["conv_rate"] + inputs["acc_rate"]
    )
    return output

Currently, this feature view result in a type error.

Describe alternatives you've considered
N/A

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions