Skip to content

Phase 4: Exception Groups Migration (PEP 654)#4877

Closed
Balandat wants to merge 1 commit into
facebook:mainfrom
Balandat:export-D91648883
Closed

Phase 4: Exception Groups Migration (PEP 654)#4877
Balandat wants to merge 1 commit into
facebook:mainfrom
Balandat:export-D91648883

Conversation

@Balandat
Copy link
Copy Markdown
Contributor

@Balandat Balandat commented Feb 9, 2026

Summary:
Convert error collection patterns to use Python 3.11 ExceptionGroup instead
of ad-hoc exception aggregation. This provides better structured exception
handling and enables the use of except* syntax in callers.

Files changed:

  • ax/core/metric.py: Update _unwrap_experiment_data(), _unwrap_trial_data_multi(),
    and _unwrap_experiment_data_multi() to raise ExceptionGroup with all collected
    errors instead of chaining to a single exception.
  • ax/generation_strategy/generation_node.py: Update new_trial_limit() to collect
    all generation-blocking errors and raise as ExceptionGroup.

Reviewed By: saitcakmak

Differential Revision: D91648883

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 9, 2026
Summary:
Convert error collection patterns to use Python 3.11 ExceptionGroup instead
of ad-hoc exception aggregation. This provides better structured exception
handling and enables the use of except* syntax in callers.

Files changed:
- ax/core/metric.py: Update _unwrap_experiment_data(), _unwrap_trial_data_multi(),
  and _unwrap_experiment_data_multi() to raise ExceptionGroup with all collected
  errors instead of chaining to a single exception.
- ax/generation_strategy/generation_node.py: Update new_trial_limit() to collect
  all generation-blocking errors and raise as ExceptionGroup.

Reviewed By: saitcakmak

Differential Revision: D91648883
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Feb 9, 2026

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

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.41176% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.75%. Comparing base (ce4dc42) to head (6d9e3f2).

Files with missing lines Patch % Lines
ax/generation_strategy/generation_node.py 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4877      +/-   ##
==========================================
- Coverage   96.75%   96.75%   -0.01%     
==========================================
  Files         591      591              
  Lines       61874    61890      +16     
==========================================
+ Hits        59869    59879      +10     
- Misses       2005     2011       +6     

☔ 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.

@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Feb 10, 2026

This pull request has been merged in 8e4112f.

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