Skip to content

Add missing pyrefly suppressions to fix main CI - #1757

Open
kartik1pandey wants to merge 1 commit into
google-deepmind:mainfrom
kartik1pandey:fix-pyrefly-ci-errors
Open

Add missing pyrefly suppressions to fix main CI#1757
kartik1pandey wants to merge 1 commit into
google-deepmind:mainfrom
kartik1pandey:fix-pyrefly-ci-errors

Conversation

@kartik1pandey

Copy link
Copy Markdown

Fixes #1756.

Summary

pyrefly check fails on main with 10 errors across 4 lines. Each is a pre-existing type-stub precision gap (not a real bug — confirmed by running the affected test suites), missed when this codebase migrated from pytype to pyrefly (#1674) or after a subsequent JAX typing change (cf. 0f6d10b).

Changes

  • linear_algebra.py: suppress missing-attribute on old_mat_h.dtype — identical pattern to the line immediately below it, which already has this suppression.
  • linesearch.py: suppress unsupported-operation on decrease_error > atoldecrease_error is typed as ArrayLike (includes complex), but is only ever assigned real values.
  • _make_pert.py: suppress bad-argument-type on baseline passed to vmapbaseline can be None, but is only read inside an if use_baseline: guard, so the None is never dereferenced.
  • projections.py: suppress bad-argument-type on unravel_fn(new_values)new_values is always a jax.Array at runtime; the union with ndarray comes from ArrayLike's breadth.

Verification

Four pre-existing pyrefly errors on main, each a type-stub precision
gap rather than a real bug (verified by running the affected test
suites): a while_loop carry variable typed as a union across all
carry slots, ArrayLike including complex in a real-only comparison,
a None baseline only read behind an if-guard, and ravel_pytree's
unravel_fn return type. Fixes google-deepmind#1756.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main CI failing on pyrefly type-check (4 pre-existing errors, unrelated to any specific PR)

1 participant