Skip to content

Commit 96216e9

Browse files
committed
fix(ffe): use NUMERIC for float types in UFC fixture
1 parent adc1a8d commit 96216e9

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

tests/ffe/test_flag_eval_metrics.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def make_ufc_fixture(flag_key: str, variant_key: str = "on", variation_type: str
2020
values: dict[str, dict[str, str | bool | float | int]] = {
2121
"STRING": {"on": "on-value", "off": "off-value"},
2222
"BOOLEAN": {"on": True, "off": False},
23-
"DOUBLE": {"on": 1.5, "off": 0.0}, # Decimal value for parse_error testing
23+
"NUMERIC": {"on": 1.5, "off": 0.0}, # Decimal value for parse_error testing
2424
"INTEGER": {"on": 42, "off": 0},
2525
}
2626
var_values = values[variation_type]
@@ -669,21 +669,17 @@ def test_ffe_eval_metric_type_mismatch(self):
669669
class Test_FFE_Eval_Metric_Parse_Error:
670670
"""Test that parsing errors produce a metric with parse_error error type.
671671
672-
This configures a DOUBLE flag with a decimal value (1.5) but evaluates it as INTEGER.
673-
In Go, this triggers a parse_error because the float has a decimal part.
674-
675-
Note: Parse error behavior may vary between tracers. This test documents
676-
the expected behavior for cross-tracer consistency.
672+
This configures a NUMERIC flag with a decimal value (1.5) but evaluates it as INTEGER.
673+
The float-to-integer conversion triggers a parse_error because the decimal part is lost.
677674
"""
678675

679676
def setup_ffe_eval_metric_parse_error(self):
680677
rc.tracer_rc_state.reset().apply()
681678

682679
config_id = "ffe-eval-metric-parse-error"
683680
self.flag_key = "eval-metric-parse-error-flag"
684-
# Flag is configured as DOUBLE with a decimal value (1.5)
685681
rc.tracer_rc_state.set_config(
686-
f"{RC_PATH}/{config_id}/config", make_ufc_fixture(self.flag_key, variation_type="DOUBLE")
682+
f"{RC_PATH}/{config_id}/config", make_ufc_fixture(self.flag_key, variation_type="NUMERIC")
687683
).apply()
688684

689685
# But we evaluate it as INTEGER → parse error (decimal can't convert to int)

0 commit comments

Comments
 (0)