Remove pyre-fixme/pyre-ignore from ax/core, ax/adapter, ax/generators test files#4989
Closed
saitcakmak wants to merge 1 commit intofacebook:mainfrom
Closed
Remove pyre-fixme/pyre-ignore from ax/core, ax/adapter, ax/generators test files#4989saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@saitcakmak has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95273495. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4989 +/- ##
=======================================
Coverage ? 96.83%
=======================================
Files ? 601
Lines ? 64693
Branches ? 0
=======================================
Hits ? 62648
Misses ? 2045
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
saitcakmak
added a commit
to saitcakmak/Ax
that referenced
this pull request
Mar 6, 2026
… test files (facebook#4989) Summary: Remove pyre-fixme and pyre-ignore type suppression comments from test files in ax/core/tests, ax/adapter/tests, ax/adapter/transforms/tests, and source file ax/adapter/transforms/one_hot.py. Uses proper type narrowing via none_throws, assert_is_instance, cast, and explicit type annotations instead of suppression comments. Key changes: - Replace `# pyre-ignore[16]` on `Parameter` attribute access with `assert_is_instance(..., RangeParameter)` / `ChoiceParameter` / `FixedParameter` - Replace `# pyre-fixme[16]` on Optional access with `none_throws(...)` - Add explicit type annotations (`TParameterization`, `TConfig`, `list[float]`, `dict[str, float | int]`) to fix type inference issues - Replace `**attrs` dict unpacking with explicit kwargs to eliminate union-type pyre errors in test_observation.py - Fix `all()` generator expression scoping bug in test_batch_trial.py (missing parentheses caused pyre-fixme[6]) - Remove unnecessary `return` statements inside `assertRaises` blocks - Add missing return type and parameter annotations on mock-decorated test methods - Refactor BoTorchGenerator construction in test_cross_validation.py to avoid pyre-ignore on `adapter.generator.surrogate` access Reviewed By: dme65 Differential Revision: D95273495
0be3bb9 to
5fd53ff
Compare
saitcakmak
added a commit
to saitcakmak/Ax
that referenced
this pull request
Mar 6, 2026
… test files (facebook#4989) Summary: Remove pyre-fixme and pyre-ignore type suppression comments from test files in ax/core/tests, ax/adapter/tests, ax/adapter/transforms/tests, and source file ax/adapter/transforms/one_hot.py. Uses proper type narrowing via none_throws, assert_is_instance, cast, and explicit type annotations instead of suppression comments. Key changes: - Replace `# pyre-ignore[16]` on `Parameter` attribute access with `assert_is_instance(..., RangeParameter)` / `ChoiceParameter` / `FixedParameter` - Replace `# pyre-fixme[16]` on Optional access with `none_throws(...)` - Add explicit type annotations (`TParameterization`, `TConfig`, `list[float]`, `dict[str, float | int]`) to fix type inference issues - Replace `**attrs` dict unpacking with explicit kwargs to eliminate union-type pyre errors in test_observation.py - Fix `all()` generator expression scoping bug in test_batch_trial.py (missing parentheses caused pyre-fixme[6]) - Remove unnecessary `return` statements inside `assertRaises` blocks - Add missing return type and parameter annotations on mock-decorated test methods - Refactor BoTorchGenerator construction in test_cross_validation.py to avoid pyre-ignore on `adapter.generator.surrogate` access Reviewed By: dme65 Differential Revision: D95273495
5fd53ff to
945732c
Compare
… test files (facebook#4989) Summary: Pull Request resolved: facebook#4989 Remove pyre-fixme and pyre-ignore type suppression comments from test files in ax/core/tests, ax/adapter/tests, ax/adapter/transforms/tests, and source file ax/adapter/transforms/one_hot.py. Uses proper type narrowing via none_throws, assert_is_instance, cast, and explicit type annotations instead of suppression comments. Key changes: - Replace `# pyre-ignore[16]` on `Parameter` attribute access with `assert_is_instance(..., RangeParameter)` / `ChoiceParameter` / `FixedParameter` - Replace `# pyre-fixme[16]` on Optional access with `none_throws(...)` - Add explicit type annotations (`TParameterization`, `TConfig`, `list[float]`, `dict[str, float | int]`) to fix type inference issues - Replace `**attrs` dict unpacking with explicit kwargs to eliminate union-type pyre errors in test_observation.py - Fix `all()` generator expression scoping bug in test_batch_trial.py (missing parentheses caused pyre-fixme[6]) - Remove unnecessary `return` statements inside `assertRaises` blocks - Add missing return type and parameter annotations on mock-decorated test methods - Refactor BoTorchGenerator construction in test_cross_validation.py to avoid pyre-ignore on `adapter.generator.surrogate` access Reviewed By: dme65 Differential Revision: D95273495
945732c to
6b96524
Compare
|
This pull request has been merged in 38bf30f. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Remove pyre-fixme and pyre-ignore type suppression comments from test files in
ax/core/tests, ax/adapter/tests, ax/adapter/transforms/tests, and source file
ax/adapter/transforms/one_hot.py. Uses proper type narrowing via none_throws,
assert_is_instance, cast, and explicit type annotations instead of suppression
comments.
Key changes:
# pyre-ignore[16]onParameterattribute access withassert_is_instance(..., RangeParameter)/ChoiceParameter/FixedParameter# pyre-fixme[16]on Optional access withnone_throws(...)TParameterization,TConfig,list[float],dict[str, float | int]) to fix type inference issues**attrsdict unpacking with explicit kwargs to eliminate union-typepyre errors in test_observation.py
all()generator expression scoping bug in test_batch_trial.py (missingparentheses caused pyre-fixme[6])
returnstatements insideassertRaisesblockspyre-ignore on
adapter.generator.surrogateaccessDifferential Revision: D95273495