Skip to content

Commit

Permalink
Remove unused suppress_all_errors kwarg (#2491)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2491

Audited usage of `suppress_all_errors` and removed the ignored kwarg (which was using the attribute set at the class level). Also added a comment on use cases where it appears to be unused, while actually getting consumed by the decorator.

Reviewed By: dme65, Balandat

Differential Revision: D58042565

fbshipit-source-id: 3396b3a1c2388d6d5bf6a21290757892ffc6b47e
  • Loading branch information
saitcakmak authored and facebook-github-bot committed Jun 1, 2024
1 parent 4100602 commit 13e3378
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions ax/service/ax_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1758,11 +1758,9 @@ def _set_generation_strategy(
def _save_generation_strategy_to_db_if_possible(
self,
generation_strategy: Optional[GenerationStrategyInterface] = None,
suppress_all_errors: bool = False,
) -> bool:
return super()._save_generation_strategy_to_db_if_possible(
generation_strategy=generation_strategy or self.generation_strategy,
suppress_all_errors=suppress_all_errors,
)

def _gen_new_generator_run(
Expand Down
11 changes: 5 additions & 6 deletions ax/service/utils/with_db_settings_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ def _save_or_update_trials_in_db_if_possible(
def _save_generation_strategy_to_db_if_possible(
self,
generation_strategy: Optional[GenerationStrategyInterface] = None,
suppress_all_errors: bool = False,
) -> bool:
"""Saves given generation strategy if DB settings are set on this
`WithDBSettingsBase` instance and the generation strategy is an
Expand Down Expand Up @@ -482,7 +481,7 @@ def _save_experiment_to_db_if_possible(
experiment: Experiment,
encoder: Encoder,
decoder: Decoder,
suppress_all_errors: bool,
suppress_all_errors: bool, # Used by the decorator.
) -> None:
start_time = time.time()
_save_experiment(
Expand All @@ -506,7 +505,7 @@ def _save_or_update_trials_in_db_if_possible(
trials: List[BaseTrial],
encoder: Encoder,
decoder: Decoder,
suppress_all_errors: bool,
suppress_all_errors: bool, # Used by the decorator.
reduce_state_generator_runs: bool = False,
) -> None:
start_time = time.time()
Expand Down Expand Up @@ -534,7 +533,7 @@ def _save_generation_strategy_to_db_if_possible(
generation_strategy: GenerationStrategy,
encoder: Encoder,
decoder: Decoder,
suppress_all_errors: bool,
suppress_all_errors: bool, # Used by the decorator.
) -> None:
start_time = time.time()
_save_generation_strategy(
Expand All @@ -558,7 +557,7 @@ def _update_generation_strategy_in_db_if_possible(
new_generator_runs: List[GeneratorRun],
encoder: Encoder,
decoder: Decoder,
suppress_all_errors: bool,
suppress_all_errors: bool, # Used by the decorator.
reduce_state_generator_runs: bool = False,
) -> None:
start_time = time.time()
Expand All @@ -585,7 +584,7 @@ def _update_generation_strategy_in_db_if_possible(
def _update_experiment_properties_in_db(
experiment_with_updated_properties: Experiment,
sqa_config: SQAConfig,
suppress_all_errors: bool,
suppress_all_errors: bool, # Used by the decorator.
) -> None:
update_properties_on_experiment(
experiment_with_updated_properties=experiment_with_updated_properties,
Expand Down

0 comments on commit 13e3378

Please sign in to comment.