fix: correct inverted default_value in _construct_random_input#6039
Open
Br1an67 wants to merge 1 commit intofeast-dev:masterfrom
Open
fix: correct inverted default_value in _construct_random_input#6039Br1an67 wants to merge 1 commit intofeast-dev:masterfrom
Br1an67 wants to merge 1 commit intofeast-dev:masterfrom
Conversation
6bfcf8f to
fcc748b
Compare
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>
fcc748b to
493d572
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
In
OnDemandFeatureView._construct_random_input, thedefault_valueassignment for missing source columns was inverted. Whensingleton=True(single row), the fallback should be a scalarNone; whensingleton=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.