Skip to content

Commit ddf273b

Browse files
DevmatePyreMissingAnnotations Botfacebook-github-bot
authored andcommitted
fbcode/spdl/autoresearch/pipeline_optimization/_ops/_analysis_ops.py (#1598)
Summary: Pull Request resolved: #1598 Differential Revision: D110483724
1 parent 8bf20b8 commit ddf273b

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/spdl/autoresearch/pipeline_optimization/_ops/_analysis_ops.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import logging
1313
from datetime import datetime
1414
from pathlib import Path
15+
from typing import TYPE_CHECKING
1516

1617
from spdl.autoresearch._common._state import (
1718
_append_master_row,
@@ -42,6 +43,9 @@
4243
from ._failures import _classify_terminal_job_failure, _failure_note, _make_failure
4344
from ._policy import _change_summary_for_spec, _format_best_metric, write_state
4445

46+
if TYPE_CHECKING:
47+
from spdl.autoresearch.core import FailureRecord
48+
4549
__all__: list[str] = [
4650
"MASTER_TABLE_HEADERS",
4751
"_analyze_job",
@@ -52,7 +56,7 @@
5256

5357
_LG: logging.Logger = logging.getLogger(__name__)
5458

55-
MASTER_TABLE_HEADERS = [
59+
MASTER_TABLE_HEADERS: list[str] = [
5660
"run_id",
5761
"name",
5862
"job_id",
@@ -70,8 +74,8 @@
7074
"notes",
7175
]
7276

73-
_STRUCTURAL_PRACTICES = {"mtp"}
74-
_STRUCTURAL_ATTEMPT_THRESHOLD = 3
77+
_STRUCTURAL_PRACTICES: set[str] = {"mtp"}
78+
_STRUCTURAL_ATTEMPT_THRESHOLD: int = 3
7579

7680

7781
def _analyze_job(
@@ -182,7 +186,7 @@ def _append_master_result_row(
182186
status: str,
183187
duration: object,
184188
structured: dict | None,
185-
terminal_failure,
189+
terminal_failure: FailureRecord | None,
186190
) -> None:
187191
# pyrefly: ignore [bad-assignment]
188192
row: dict[str, str | float] = {

0 commit comments

Comments
 (0)