feat: Feast First-Class LabelView Implementation#6292
feat: Feast First-Class LabelView Implementation#6292ntkathole wants to merge 1 commit intofeast-dev:masterfrom
Conversation
0f755c2 to
468ea54
Compare
623acc0 to
d8daa1f
Compare
85c9875 to
2678090
Compare
JiwaniZakir
left a comment
There was a problem hiding this comment.
In docs/getting-started/concepts/label-view.md, the LabelView definition example includes interaction_id both as the entity join key (Entity(join_keys=["interaction_id"])) and as an explicit Field inside the schema list. Standard Feast FeatureView definitions typically exclude join-key columns from the schema since they're inferred from the entity definition — duplicating them here either reflects an inconsistency with how the underlying implementation handles schema validation, or it will silently produce duplicate columns. This should either be removed from the schema to match Feast conventions or explicitly documented as a required pattern specific to LabelView.
On the alpha-limitations transparency: documenting that conflict_policy and retain_history are persisted but not enforced is the right call, but consider surfacing a runtime warning (e.g., a UserWarning on apply() or push()) when a non-default ConflictPolicy or retain_history=True is configured. As written, users who set ConflictPolicy.MAJORITY_VOTE will silently get last-write-wins behavior, which is a subtle correctness hazard that the docs alone may not prevent.
Thanks for review @JiwaniZakir. Can you please re-confirm - this is how regular feature view works, it isn't duplication.
valid point but the next PR will have support for conflict_policy and retain_history and required changes in online store. |
|
The Python 3.12 worker crash in |
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
What this PR does / why we need it:
RFC - https://docs.google.com/document/d/1mcJM0sHeBk269oMIsLsLnAlrMtgnxn5Pws0oEeogc48/edit?usp=sharing
Summary
Introduces
LabelView, a new alpha-stage Feast primitive that manages mutable labels and annotations separately from immutable feature data stored in regularFeatureViews. This supports multi-labeler workflows (human reviewers, automated safety scanners, reward models) where different sources independently write labels for the same entity keys.LabelView is fully opt-in — existing workflows are unaffected unless a user explicitly defines one.
What's included
Core implementation (
feast.labelingmodule)LabelViewclass inheriting fromBaseFeatureView, with label-specific attributes:labeler_field,conflict_policy,retain_history,reference_feature_viewConflictPolicyenum (LAST_WRITE_WINS,LABELER_PRIORITY,MAJORITY_VOTE)LabelView.proto) withLabelViewSpec,LabelViewMeta, andConflictResolutionPolicyFull SDK integration
FeatureStore.apply()— registers LabelViews, auto-registers their PushSource, validates name uniqueness across all view typesFeatureStore.push()— routes push data to LabelView when its PushSource matchesFeatureStore.get_historical_features()— works viabatch_source/stream_sourceproperties on LabelViewFeatureStore.teardown()— includes LabelView tablesFeatureStore.list_label_views()/get_label_view()— new public API methodsFeatureServicecomposability — LabelViews can be included alongside regular feature viewsRegistry support (all backends)
label_viewstable,_infer_fv_table/_infer_fv_classessupport, proto() builderlabel_viewarm added toApplyFeatureViewRequestoneof, full client + server wiringLABEL_VIEWStable, correct column-name mapping indelete_feature_viewCLI
feast label-views list— lists all label views with name, entities, conflict policyfeast label-views describe <name>— shows full label view detailsfeast feature-views listunchanged (label views are only in their dedicated command)Permissions
LABEL_VIEW = 11added toPermission.protoType enum_PERMISSION_TYPESmap updated forfrom_proto/to_protoroundtripRegression safety
feast materialize/materialize-incremental(labels come in viapush(), not batch materialization); explicit error if attempted by namefeature-views listoutputproto()builders includelabel_viewsso cached/exported blobs are complete_ensure_feature_view_name_is_uniqueDocumentation
[Alpha]tags and Google-style Args blocks on all public classes/methodsLabelViewandConflictPolicydocs/getting-started/concepts/label-view.md) with usage examples, conflict policies, and alpha limitationsconflict_policystored but not enforced at read time (requires online-store query-path changes);retain_historystored but not enforced at write time (requires online-store write-path changes); batch materialization not supportedTests
Alpha Limitations
conflict_policy— persisted in registry metadata but not enforced duringget_online_features. Online store returns last-written row regardless of policy.retain_history— persisted but not acted on. Online store always overwrites previous value.FeatureStore.push()only.Test Plan
test_label_view.pyunit tests passtest_registry_diff.pytests pass (includingtest_diff_registry_objects_permissions)feast applywith a repo containing a LabelView definitionfeast label-views list/feast label-views describeFeatureStore.push()to a LabelView's PushSourceWhich issue(s) this PR fixes:
#5456