Remove pyre-fixme/pyre-ignore from ax/service, ax/storage, ax/utils test files#4990
Closed
saitcakmak wants to merge 3 commits into
Closed
Remove pyre-fixme/pyre-ignore from ax/service, ax/storage, ax/utils test files#4990saitcakmak wants to merge 3 commits into
saitcakmak wants to merge 3 commits into
Conversation
Summary: Remove ~124 pyre-fixme/pyre-ignore suppression comments from 22 source files in ax/storage/ by applying proper type fixes: - Use `cast(type[SQAClass], ...)` for SQA class lookups from config dicts - Use `cast(type[Enum], enum)` for enum value/name access - Change bare `type` to `type[Any]` in registry function signatures - Use `assert_is_instance()` for JSON dict key narrowing - Add proper type annotations for Generator return types - Use `none_throws()` for generation strategy ID access - Fix SQLAlchemy TypeDecorator parameter types Remaining pyre errors are pre-existing SQLAlchemy/BoTorch stub mismatches that cannot be fixed without changing library type stubs. Differential Revision: D95264795
… test files 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 Differential Revision: D95273495
|
@saitcakmak has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95273568. |
saitcakmak
added a commit
to saitcakmak/Ax
that referenced
this pull request
Mar 6, 2026
…est files (facebook#4990) Summary: Pull Request resolved: facebook#4990 Remove pyre-fixme and pyre-ignore type suppression comments from test files in ax/service/tests, ax/storage/*/tests, and ax/utils/*/tests. Uses proper type narrowing via none_throws, assert_is_instance, cast, and explicit type annotations instead of suppression comments. Differential Revision: D95273568
dabf27d to
19bc53d
Compare
saitcakmak
added a commit
to saitcakmak/Ax
that referenced
this pull request
Mar 6, 2026
…est files (facebook#4990) Summary: Pull Request resolved: facebook#4990 Remove pyre-fixme and pyre-ignore type suppression comments from test files in ax/service/tests, ax/storage/*/tests, and ax/utils/*/tests. Uses proper type narrowing via none_throws, assert_is_instance, cast, and explicit type annotations instead of suppression comments. Differential Revision: D95273568
19bc53d to
c47c956
Compare
…est files (facebook#4990) Summary: Pull Request resolved: facebook#4990 Remove pyre-fixme and pyre-ignore type suppression comments from test files in ax/service/tests, ax/storage/*/tests, and ax/utils/*/tests. Uses proper type narrowing via none_throws, assert_is_instance, cast, and explicit type annotations instead of suppression comments. Differential Revision: D95273568
c47c956 to
7bf020e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4990 +/- ##
=======================================
Coverage 96.83% 96.84%
=======================================
Files 601 601
Lines 64662 64717 +55
=======================================
+ Hits 62616 62673 +57
+ Misses 2046 2044 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This pull request has been merged in 9a79809. |
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/service/tests, ax/storage//tests, and ax/utils//tests. Uses proper type narrowing
via none_throws, assert_is_instance, cast, and explicit type annotations instead of
suppression comments.
Differential Revision: D95273568