Skip to content

fix: do not pass undeclared feature view columns to ODFV UDFs#6527

Open
Vedant-Agarwal wants to merge 1 commit into
feast-dev:masterfrom
Vedant-Agarwal:fix/odfv-source-isolation
Open

fix: do not pass undeclared feature view columns to ODFV UDFs#6527
Vedant-Agarwal wants to merge 1 commit into
feast-dev:masterfrom
Vedant-Agarwal:fix/odfv-source-isolation

Conversation

@Vedant-Agarwal

Copy link
Copy Markdown

What

An OnDemandFeatureView's UDF (pandas and python modes) was receiving every feature column in the online response, including features from feature views that the ODFV did not list in its sources. This allowed a UDF to silently depend on an undeclared source.

This filters the UDF input down to the ODFV's declared sources before the transform runs. Join keys, request-source fields and the declared features are kept; only columns from undeclared feature views are removed. substrait already restricts its inputs through its query plan, so it is left as is.

Fixes #6158.

Tests

Three tests were added in test_on_demand_pandas_transformation.py:

  • pandas mode: the UDF sees its declared feature and the entity join key, but not another requested feature view's column.
  • python mode: the same check with the dict input.
  • two ODFVs: one ODFV's UDF does not see the other ODFV's source column, even when that feature view is present only as the other ODFV's input.

Each of these fails on the current code and passes with this change.

Functional test results:

$ pytest tests/unit/test_on_demand_pandas_transformation.py \
    -k "undeclared or other_requested_odfv"
3 passed in 0.52s

ruff and mypy are clean.

Scope

This covers the online path (get_online_features), which is what the issue reports. The offline path (get_historical_features) has the same shape and can be addressed as a follow-up.

An OnDemandFeatureView's UDF was receiving every feature column in the online response, including features from feature views that the ODFV did not list in its sources. That allowed a UDF to silently depend on an undeclared source.

This filters the UDF input down to the ODFV's declared sources before the transform runs, so columns from undeclared feature views are hidden. Join keys, request data and the declared features are kept. substrait already restricts its inputs through its query plan, so it is left as is.

Fixes feast-dev#6158.

Signed-off-by: Vedant Agarwal <vedantagwl10@gmail.com>
@Vedant-Agarwal Vedant-Agarwal requested a review from a team as a code owner June 15, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OnDemandFeatureView (pandas/python mode) UDF receives all response columns, not just declared sources

1 participant