From ae04807b10bc96b75b675a75009ff5dcf727d4f9 Mon Sep 17 00:00:00 2001 From: Sam Goldman Date: Fri, 13 Nov 2026 15:03:59 -0800 Subject: [PATCH] Upgrade packages to Pyrefly R1545.3 (landing group 215) Summary: This Phabricator Diff was generated from Pyrefly type-checker output by the per-target upgrade tool. It was not generated by an AI coding system. It adds `# pyrefly: ignore[...]` comments for type errors reported by Pyrefly R1545.3 and moves the packages it suppresses errors in to that release in `tools/build_defs/fbcode_macros/build_defs/rollouts/pyrefly_checker_rollout.bzl`, so they switch type checkers in the commit that adds their suppressions. Other packages move when the upgrade changes the default checker. It does not change Python runtime behavior or application logic. Landing group: `pyre_landing_split:1163914179934454:2` (attempt 1, 5 batches, 34 files) Merged patch SHA-256: `6e8b8c69e12b5a8f340d5bc3d3144f4c6f1581f34fac865e789b3191d39e635c` Packages moved to R1545.3: 20 Rebased by hand onto master and re-checked the 595 labels whose packages check with R1545.3 on master: no new errors. #pyreupgrade Differential Revision: D131838810 --- ax/generation_strategy/tests/test_generation_strategy.py | 1 + ax/generators/torch/botorch_modular/acquisition.py | 1 + ax/utils/measurement/synthetic_functions.py | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ax/generation_strategy/tests/test_generation_strategy.py b/ax/generation_strategy/tests/test_generation_strategy.py index 4a6c22f8a9c..9238ecfaf97 100644 --- a/ax/generation_strategy/tests/test_generation_strategy.py +++ b/ax/generation_strategy/tests/test_generation_strategy.py @@ -1873,6 +1873,7 @@ def test_node_gs_with_auto_transitions_three_phase(self) -> None: self.assertEqual(trial.generator_runs[2]._generation_node_name, "sobol_3") # after running the next trial should be made from sobol 4 + # pyrefly: ignore [unbound-name] trial.run() trial = exp.new_batch_trial(generator_runs=gs_2.gen(exp)[0]) self.assertEqual(trial.generator_runs[0]._generation_node_name, "sobol_4") diff --git a/ax/generators/torch/botorch_modular/acquisition.py b/ax/generators/torch/botorch_modular/acquisition.py index fd8e7421c7f..4dfda6c11ff 100644 --- a/ax/generators/torch/botorch_modular/acquisition.py +++ b/ax/generators/torch/botorch_modular/acquisition.py @@ -542,6 +542,7 @@ def select_from_candidate_set( # Otherwise, use direct selection mode. num_samples_attr = getattr(sampling_strategy, "num_samples", None) num_samples: int | None = ( + # pyrefly: ignore [bad-argument-type] int(num_samples_attr) if num_samples_attr is not None else None ) diff --git a/ax/utils/measurement/synthetic_functions.py b/ax/utils/measurement/synthetic_functions.py index c499d78e28f..d40a2e46561 100644 --- a/ax/utils/measurement/synthetic_functions.py +++ b/ax/utils/measurement/synthetic_functions.py @@ -259,7 +259,7 @@ class Branin(SyntheticFunction): _required_dimensionality = 2 _domain: list[tuple[float, float]] = [(-5.0, 10.0), (0.0, 15.0)] - # pyrefly: ignore [bad-override-mutable-attribute] + # pyrefly: ignore [bad-override, bad-override-mutable-attribute] _minimums: list[tuple[float, float]] = [ (-np.pi, 12.275), (np.pi, 2.275), @@ -285,7 +285,7 @@ class Aug_Branin(SyntheticFunction): _required_dimensionality = 3 _domain: list[tuple[float, float]] = [(-5.0, 10.0), (0.0, 15.0), (0.0, 1.0)] - # pyrefly: ignore [bad-override-mutable-attribute] + # pyrefly: ignore [bad-override, bad-override-mutable-attribute] _minimums: list[tuple[float, float, float]] = [ (-np.pi, 12.275, 1.0), (np.pi, 2.275, 1.0),