Skip to content

Make all mark_* methods on BaseTrial no-op when status is unchanged#5097

Closed
lena-kashtelyan wants to merge 1 commit into
facebook:mainfrom
lena-kashtelyan:export-D97785459
Closed

Make all mark_* methods on BaseTrial no-op when status is unchanged#5097
lena-kashtelyan wants to merge 1 commit into
facebook:mainfrom
lena-kashtelyan:export-D97785459

Conversation

@lena-kashtelyan
Copy link
Copy Markdown
Contributor

Summary:
NOTE: Please see D97329836 for context; curious what folks think of this change. IMO applying the change in that diff only to mark_as will cause confusion in the future.

Claude below

Extend the no-op-on-same-status pattern from mark_as to every
individual mark_* method on BaseTrial. This ensures that calling
any status-marking method on a trial that is already in that status
is a safe no-op that does not overwrite timestamps, regardless of
whether the caller goes through mark_as or calls the specific
method directly.

Reviewed By: Cesar-Cardoso

Differential Revision: D97785459

Summary:
NOTE: Please see D97329836 for context; curious what folks think of this change. IMO applying the change in that diff only to `mark_as` will cause confusion in the future.

## Claude below

Extend the no-op-on-same-status pattern from `mark_as` to every
individual `mark_*` method on `BaseTrial`. This ensures that calling
any status-marking method on a trial that is already in that status
is a safe no-op that does not overwrite timestamps, regardless of
whether the caller goes through `mark_as` or calls the specific
method directly.

Reviewed By: Cesar-Cardoso

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

meta-codesync Bot commented Mar 24, 2026

@lena-kashtelyan has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97785459.

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 24, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.70588% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.29%. Comparing base (6e527d5) to head (5b956f6).

Files with missing lines Patch % Lines
ax/core/base_trial.py 57.14% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5097      +/-   ##
==========================================
- Coverage   96.30%   96.29%   -0.02%     
==========================================
  Files         611      611              
  Lines       67534    67549      +15     
==========================================
+ Hits        65040    65047       +7     
- Misses       2494     2502       +8     

☔ 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 Mar 25, 2026

This pull request has been merged in e167d7c.

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.

2 participants