1717from ads .opctl import logger
1818
1919from ..operator_config import AnomalyOperatorConfig , AnomalyOperatorSpec
20- from .anomaly_dataset import AnomalyDatasets , AnomalyOutput
20+ from .anomaly_dataset import AnomalyDatasets , AnomalyOutput , TestData
2121from ads .opctl .operator .lowcode .anomaly .const import OutputColumns , SupportedMetrics
2222from ..const import SupportedModels
2323from ads .opctl .operator .lowcode .common .utils import (
@@ -69,7 +69,7 @@ def generate_report(self):
6969 test_data = None
7070
7171 if self .spec .test_data :
72- test_data = TestData (self .spec . test_data )
72+ test_data = TestData (self .spec )
7373 total_metrics , summary_metrics = self ._test_data_evaluate_metrics (
7474 anomaly_output , test_data , elapsed_time
7575 )
@@ -170,8 +170,6 @@ def _evaluation_metrics(self, anomaly_output):
170170 def _test_data_evaluate_metrics (self , anomaly_output , test_data , elapsed_time ):
171171 total_metrics = pd .DataFrame ()
172172 summary_metrics = pd .DataFrame ()
173- if test_data .empty :
174- return total_metrics , summary_metrics , None
175173
176174 for cat in anomaly_output .list_categories ():
177175 output = anomaly_output .category_map [cat ][0 ]
@@ -191,7 +189,7 @@ def _test_data_evaluate_metrics(self, anomaly_output, test_data, elapsed_time):
191189 total_metrics = pd .concat ([total_metrics , metrics_df ], axis = 1 )
192190
193191 if total_metrics .empty :
194- return total_metrics , summary_metrics , data
192+ return total_metrics , summary_metrics
195193
196194 summary_metrics = pd .DataFrame (
197195 {
0 commit comments