MCPcopy Index your code
hub / github.com/feast-dev/feast / _sample_label_view

Function _sample_label_view

sdk/python/tests/unit/test_label_view.py:19–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18
19def _sample_label_view() -> LabelView:
20 interaction = Entity(
21 name="interaction",
22 join_keys=["interaction_id"],
23 value_type=ValueType.STRING,
24 )
25 label_push = PushSource(
26 name="label_push",
27 batch_source=FileSource(path="labels.parquet", timestamp_field="ts"),
28 )
29 return LabelView(
30 name="interaction_labels",
31 source=label_push,
32 entities=[interaction],
33 schema=[
34 Field(name="interaction_id", dtype=String),
35 Field(name="reward_label", dtype=String),
36 Field(name="safety_score", dtype=Float32),
37 Field(name="labeler", dtype=String),
38 ],
39 labeler_field="labeler",
40 conflict_policy=ConflictPolicy.LAST_WRITE_WINS,
41 reference_feature_view="interaction_history",
42 ttl=timedelta(days=90),
43 online=True,
44 description="Mutable reward labels",
45 tags={"team": "safety"},
46 owner="safety@example.com",
47 )
48
49
50class TestLabelViewCreation:

Calls 5

EntityClass · 0.90
PushSourceClass · 0.90
FileSourceClass · 0.90
LabelViewClass · 0.90
FieldClass · 0.90

Tested by

no test coverage detected