You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Numeric guards leak OverflowError for very large inputs #739
The shared numeric guards can raise an unlabelled OverflowError while checking caller input. On main at 7d202bc:
fromfractionsimportFractionfromhflow.batchingimportplan_batchesfromhflow.transformimportTransformConfigTransformConfig(gop_seconds=10**400)
# OverflowError: int too large to convert to floatplan_batches({'item': 1}, batch_count=1, stagger_interval_s=Fraction(10**400, 1))
# OverflowError: integer division result too large for a float
src/hflow/_field_guards.py:67 and :91 pass these values to math.isfinite, which converts them to float. Other invalid values already raise ValueError naming the field.
Done when
Values too large for the floating-point check raise a field-specific ValueError at both public entry points, including a large integer and a large Fraction.
Valid integer, float, and Fraction inputs keep their existing behavior, including exact fractional batch delays.
Extend the boundary tests in tests/test_batching.py:129 and the transform settings tests. The existing guards in src/hflow/_field_guards.py show the error-message pattern.
Validation
uv sync --locked
uv run ruff check --fix
uv run ruff format
uv run ty check
uv run pytest -q
Activity
yoveneim commentedon Oct 27, 2026
Hi , I would like to work on this one .
kstonekuan commentedon Oct 27, 2026
thanks, assigned
fix(guards): name the field when a numeric value is too large for flo…