Skip to content

fix: correct inverted default_value in _construct_random_input#6039

Open
Br1an67 wants to merge 1 commit intofeast-dev:masterfrom
Br1an67:fix/inverted-default-value
Open

fix: correct inverted default_value in _construct_random_input#6039
Br1an67 wants to merge 1 commit intofeast-dev:masterfrom
Br1an67:fix/inverted-default-value

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 1, 2026

What this PR does / why we need it:

In OnDemandFeatureView._construct_random_input, the default_value assignment for missing source columns was inverted. When singleton=True (single row), the fallback should be a scalar None; when singleton=False (batch), it should be [None]. The existing code had these swapped, causing downstream errors when the random input was consumed.

Which issue(s) this PR fixes:

Fixes #6008

Misc

One-line fix in sdk/python/feast/on_demand_feature_view.py.


Open with Devin

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@Br1an67 Br1an67 force-pushed the fix/inverted-default-value branch from 6bfcf8f to fcc748b Compare March 1, 2026 08:03
When singleton=True, the fallback should be scalar None, not [None].
When singleton=False, the fallback should be [None], not None.

The condition was inverted, causing incorrect UDF schema inference
for feature types not present in sample_values.

Fixes feast-dev#6008

Signed-off-by: Br1an67 <932039080@qq.com>
@Br1an67 Br1an67 force-pushed the fix/inverted-default-value branch from fcc748b to 493d572 Compare March 1, 2026 08:08
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.

Fix inverted default_value logic in OnDemandFeatureView._construct_random_input

1 participant