Skip to content

Commit c564faa

Browse files
shrutipatel31facebook-github-bot
authored andcommitted
Include INFO status healthcheck cards in overview to save to db
Summary: In order for the INFO healthcheck cards to be shown in the Ax UI, they need to be saved to the db. This diff adds those cards to overview cards so they can be saved appropriately. Differential Revision: D96492464
1 parent 1e48d0f commit c564faa

2 files changed

Lines changed: 58 additions & 2 deletions

File tree

ax/analysis/overview.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
ConstraintsFeasibilityAnalysis,
2121
)
2222
from ax.analysis.healthcheck.early_stopping_healthcheck import EarlyStoppingAnalysis
23-
from ax.analysis.healthcheck.healthcheck_analysis import HealthcheckAnalysisCard
23+
from ax.analysis.healthcheck.healthcheck_analysis import (
24+
HealthcheckAnalysisCard,
25+
HealthcheckStatus,
26+
)
2427
from ax.analysis.healthcheck.metric_fetching_errors import MetricFetchingErrorsAnalysis
2528
from ax.analysis.healthcheck.predictable_metrics import PredictableMetricsAnalysis
2629
from ax.analysis.healthcheck.search_space_analysis import SearchSpaceAnalysis
@@ -268,7 +271,12 @@ def compute(
268271
non_passing_health_checks = [
269272
card
270273
for card in health_check_cards
271-
if (isinstance(card, HealthcheckAnalysisCard) and not card.is_passing())
274+
if (
275+
isinstance(card, HealthcheckAnalysisCard)
276+
and (
277+
not card.is_passing() or card.get_status() == HealthcheckStatus.INFO
278+
)
279+
)
272280
or isinstance(card, ErrorAnalysisCard)
273281
]
274282

ax/analysis/tests/test_overview.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
import pandas as pd
1212
from ax.adapter.base import Adapter
1313
from ax.adapter.registry import Generators
14+
from ax.analysis.healthcheck.healthcheck_analysis import (
15+
create_healthcheck_analysis_card,
16+
HealthcheckStatus,
17+
)
1418
from ax.analysis.insights import InsightsAnalysis
1519
from ax.analysis.overview import OverviewAnalysis
1620
from ax.analysis.plotly.arm_effects import ArmEffectsPlot
@@ -447,3 +451,47 @@ def test_insights_analysis_single_parameter(self) -> None:
447451
# Check that none of the cards are error cards
448452
for card in all_cards:
449453
self.assertNotIsInstance(card, ErrorAnalysisCard)
454+
455+
def test_info_status_healthcheck_cards_in_overview(self) -> None:
456+
"""Test that healthcheck cards with INFO status are included in overview."""
457+
# Create healthcheck cards with different statuses
458+
pass_card = create_healthcheck_analysis_card(
459+
name="PassCheck",
460+
title="Pass Healthcheck",
461+
subtitle="This check passed",
462+
df=pd.DataFrame(),
463+
status=HealthcheckStatus.PASS,
464+
)
465+
info_card = create_healthcheck_analysis_card(
466+
name="InfoCheck",
467+
title="Info Healthcheck",
468+
subtitle="This is informational",
469+
df=pd.DataFrame(),
470+
status=HealthcheckStatus.INFO,
471+
)
472+
warning_card = create_healthcheck_analysis_card(
473+
name="WarningCheck",
474+
title="Warning Healthcheck",
475+
subtitle="This is a warning",
476+
df=pd.DataFrame(),
477+
status=HealthcheckStatus.WARNING,
478+
)
479+
fail_card = create_healthcheck_analysis_card(
480+
name="FailCheck",
481+
title="Fail Healthcheck",
482+
subtitle="This check failed",
483+
df=pd.DataFrame(),
484+
status=HealthcheckStatus.FAIL,
485+
)
486+
487+
# INFO cards should be considered passing
488+
self.assertTrue(info_card.is_passing())
489+
self.assertTrue(pass_card.is_passing())
490+
self.assertFalse(warning_card.is_passing())
491+
self.assertFalse(fail_card.is_passing())
492+
493+
# Verify INFO status is correctly retrieved
494+
self.assertEqual(info_card.get_status(), HealthcheckStatus.INFO)
495+
self.assertEqual(pass_card.get_status(), HealthcheckStatus.PASS)
496+
self.assertEqual(warning_card.get_status(), HealthcheckStatus.WARNING)
497+
self.assertEqual(fail_card.get_status(), HealthcheckStatus.FAIL)

0 commit comments

Comments
 (0)