()
| 17 | |
| 18 | |
| 19 | def _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 | |
| 50 | class TestLabelViewCreation: |
no test coverage detected