Skip to content

Commit 70f60e5

Browse files
saitcakmakmeta-codesync[bot]
authored andcommitted
Remove dead recoverable_exceptions and is_recoverable_fetch_e (facebook#5120)
Summary: Pull Request resolved: facebook#5120 Follow-up to D98924467, which decoupled metric fetch errors from trial status in the Orchestrator. The orchestrator no longer uses `recoverable_exceptions` or `is_recoverable_fetch_e` to decide trial fate, making them dead code. - Remove `Metric.recoverable_exceptions` class attribute and `Metric.is_recoverable_fetch_e` classmethod from `ax/core/metric.py`. Reviewed By: bernardbeckerman Differential Revision: D98932195
1 parent 02e06ae commit 70f60e5

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

ax/core/metric.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ class Metric(SortableBase, SerializationMixin):
8888
properties: Properties specific to a particular metric.
8989
"""
9090

91-
# The set of exception types stored in a ``MetchFetchE.exception`` that are
92-
# recoverable ``orchestrator._fetch_and_process_trials_data_results()``.
93-
# Exception may be a subclass of any of these types. If you want your metric
94-
# to never fail the trial, set this to ``{Exception}`` in your metric subclass.
95-
recoverable_exceptions: set[type[Exception]] = set()
9691
has_map_data: bool = False
9792

9893
def __init__(
@@ -164,17 +159,6 @@ def period_of_new_data_after_trial_completion(cls) -> timedelta:
164159
"""
165160
return timedelta(0)
166161

167-
@classmethod
168-
def is_recoverable_fetch_e(cls, metric_fetch_e: MetricFetchE) -> bool:
169-
"""Checks whether the given MetricFetchE is recoverable for this metric class
170-
in ``orchestrator._fetch_and_process_trials_data_results``.
171-
"""
172-
if metric_fetch_e.exception is None:
173-
return False
174-
return any(
175-
isinstance(metric_fetch_e.exception, e) for e in cls.recoverable_exceptions
176-
)
177-
178162
# NOTE: This is rarely overridden –– oonly if you want to fetch data in groups
179163
# consisting of multiple different metric classes, for data to be fetched together.
180164
# This makes sense only if `fetch_trial data_multi` or `fetch_experiment_data_multi`

0 commit comments

Comments
 (0)