test(protocol): parametrize temporal feature validator tests + float literals
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -153,14 +153,14 @@ def test_feature_unknown_column_fails() -> None:
|
|||||||
validate_strategy(ast)
|
validate_strategy(ast)
|
||||||
|
|
||||||
|
|
||||||
def test_validator_accepts_temporal_features() -> None:
|
@pytest.mark.parametrize("name", ["hour", "dow", "is_weekend", "minute_of_hour"])
|
||||||
for name in ("hour", "dow", "is_weekend", "minute_of_hour"):
|
def test_validator_accepts_temporal_feature(name: str) -> None:
|
||||||
src = _wrap(
|
src = _wrap(
|
||||||
{
|
{
|
||||||
"op": "gt",
|
"op": "gt",
|
||||||
"args": [
|
"args": [
|
||||||
{"kind": "feature", "name": name},
|
{"kind": "feature", "name": name},
|
||||||
{"kind": "literal", "value": 0},
|
{"kind": "literal", "value": 0.0},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -174,7 +174,7 @@ def test_validator_rejects_temporal_typo() -> None:
|
|||||||
"op": "gt",
|
"op": "gt",
|
||||||
"args": [
|
"args": [
|
||||||
{"kind": "feature", "name": "weekday"},
|
{"kind": "feature", "name": "weekday"},
|
||||||
{"kind": "literal", "value": 0},
|
{"kind": "literal", "value": 0.0},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user