Skip to content

Remove pyre-fixme/pyre-ignore from ax/core, ax/adapter, ax/generators test files#4989

Closed
saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak:export-D95273495
Closed

Remove pyre-fixme/pyre-ignore from ax/core, ax/adapter, ax/generators test files#4989
saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak:export-D95273495

Conversation

@saitcakmak
Copy link
Contributor

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

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 6, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 6, 2026

@saitcakmak has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95273495.

@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@6560861). Learn more about missing BASE report.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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
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
… 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
@meta-codesync
Copy link

meta-codesync bot commented Mar 6, 2026

This pull request has been merged in 38bf30f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants