Skip to content

Commit 3673a40

Browse files
author
Sushanth Sathish Kumar
committed
fix: Fix source code to properly filter using dashboard variables and modify test_dashboard_methods to take into account the new filters in the dashboard variables
1 parent 5b054a7 commit 3673a40

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/sagemaker/dashboard/data_quality_dashboard.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _generate_variables(self):
120120
variable_id="Feature",
121121
label="Feature",
122122
search=self.DATA_QUALITY_METRICS_BATCH_NAMESPACE
123-
+ f'MonitoringSchedule="{self.monitoring_schedule}" ',
123+
+ f' MonitoringSchedule="{self.monitoring_schedule}" ',
124124
populateFrom="Feature",
125125
)
126126
]
@@ -133,8 +133,8 @@ def _generate_variables(self):
133133
variable_id="Feature",
134134
label="Feature",
135135
search=self.DATA_QUALITY_METRICS_ENDPOINT_NAMESPACE
136-
+ f'Endpoint="{self.endpoint}" '
137-
+ f'MonitoringSchedule="{self.monitoring_schedule}" ',
136+
+ f' Endpoint="{self.endpoint}"'
137+
+ f' MonitoringSchedule="{self.monitoring_schedule}" ',
138138
populateFrom="Feature",
139139
)
140140
]

tests/unit/test_dashboard_methods.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ def test_automatic_data_quality_dashboard_endpoint():
118118
inputType="select",
119119
variable_id="Feature",
120120
label="Feature",
121-
search="{aws/sagemaker/Endpoints/data-metrics,Endpoint,Feature,MonitoringSchedule}",
121+
search="{aws/sagemaker/Endpoints/data-metrics,Endpoint,Feature,MonitoringSchedule}"
122+
+ ' Endpoint="endpoint"'
123+
+ ' MonitoringSchedule="monitoring_schedule" ',
122124
populateFrom="Feature",
123125
)
124126
]
@@ -259,7 +261,7 @@ def test_automatic_data_quality_dashboard_endpoint():
259261
]
260262
],
261263
}
262-
264+
263265
assert dashboard.to_dict() == expected_dashboard
264266

265267

@@ -271,7 +273,8 @@ def test_automatic_data_quality_dashboard_batch_transform():
271273
inputType="select",
272274
variable_id="Feature",
273275
label="Feature",
274-
search="{aws/sagemaker/ModelMonitoring/data-metrics,Feature,MonitoringSchedule}",
276+
search="{aws/sagemaker/ModelMonitoring/data-metrics,Feature,MonitoringSchedule}"
277+
+ ' MonitoringSchedule="monitoring_schedule" ',
275278
populateFrom="Feature",
276279
)
277280
]

0 commit comments

Comments
 (0)