From f5198b6936313f1c191b706bb89afba7de0694e9 Mon Sep 17 00:00:00 2001 From: Sam Goldman Date: Fri, 13 Nov 2026 16:03:53 -0800 Subject: [PATCH] Upgrade packages to Pyrefly R1545.3 (landing group 216) Summary: X-link: https://github.com/meta-pytorch/torchrec/pull/5048 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:3` (attempt 1, 5 batches, 70 files) Merged patch SHA-256: `03836d36d8834219f1f87e83ffd74283b66e13a723db66c6bb24f10bd2a47a35` Packages moved to R1545.3: 25 Rebased by hand onto master, where `recir/utils/compile.py` conflicted, keeping master's version of it, then re-checked the 641 labels whose packages check with R1545.3 on master: no new errors. #pyreupgrade Differential Revision: D131835429 --- ax/adapter/tests/test_torch_adapter.py | 1 + ax/adapter/transforms/map_key_to_float.py | 2 +- ax/early_stopping/strategies/base.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ax/adapter/tests/test_torch_adapter.py b/ax/adapter/tests/test_torch_adapter.py index adfc19ddc1a..dbc01252113 100644 --- a/ax/adapter/tests/test_torch_adapter.py +++ b/ax/adapter/tests/test_torch_adapter.py @@ -1227,6 +1227,7 @@ def test_pairwise_preference_generator(self) -> None: parameter_names = list(experiment.parameters.keys()) outcomes = [assert_is_instance(Keys.PAIRWISE_PREFERENCE_QUERY.value, str)] + # pyrefly: ignore [unbound-name] datasets, _, candidate_metadata = pmb._convert_experiment_data( experiment_data=pmb._training_data, outcomes=outcomes, diff --git a/ax/adapter/transforms/map_key_to_float.py b/ax/adapter/transforms/map_key_to_float.py index 5f5a0de1e52..0a32d7400bb 100644 --- a/ax/adapter/transforms/map_key_to_float.py +++ b/ax/adapter/transforms/map_key_to_float.py @@ -111,7 +111,7 @@ def __init__( parameters = {MAP_KEY: {}} self.parameters: dict[str, dict[str, Any]] = parameters - # pyrefly: ignore [bad-override-mutable-attribute] + # pyrefly: ignore [bad-override, bad-override-mutable-attribute] self._parameter_list: list[RangeParameter] = [] # Construct the parameter if needed. if is_map_data: diff --git a/ax/early_stopping/strategies/base.py b/ax/early_stopping/strategies/base.py index 57a99e993ab..afdcd22e66e 100644 --- a/ax/early_stopping/strategies/base.py +++ b/ax/early_stopping/strategies/base.py @@ -323,6 +323,7 @@ def _log_and_return_interval_boundary( next_boundary = curr_boundary + interval reason = ( + # pyrefly: ignore [invalid-argument] f"Trial has not crossed an interval boundary. " f"Progressed from {prev_progression:.2f} to {curr_progression:.2f}; " f"both are in the same interval [{curr_boundary:.2f}, "