@@ -221,28 +221,36 @@ def get_run_metric_span(self, *, run_id: str, metric_name: str) -> dict:
221221 metric to retrieve span information for.
222222
223223 Returns
224- ------
224+ -------
225225 dict[str, list[dict[str, float]]
226226 dictionary containing span from this for the run at specified step.
227227 """
228228 _response = sv_get (
229- url = f"{ self .run_metric_values_url (run_id , metric_name ) / 'span' } " ,
229+ url = f"{ self .run_metric_url (run_id , metric_name ) / 'span' } " ,
230230 headers = self ._headers ,
231231 )
232232
233- return get_json_from_response (
234- response = _response ,
235- expected_status = [http .HTTPStatus .OK ],
236- expected_type = dict ,
237- scenario = f"Retrieving grid span for run '{ run_id } '" ,
233+ _response = typing .cast (
234+ "list[dict[str, int | float | str]]" ,
235+ get_json_from_response (
236+ response = _response ,
237+ expected_status = [http .HTTPStatus .OK ],
238+ expected_type = list ,
239+ scenario = f"Retrieving grid span for run '{ run_id } '" ,
240+ ),
238241 )
239242
243+ if not _response :
244+ raise RuntimeError ("Failed to retrieve span, no data." )
245+
246+ return _response [0 ]
247+
240248 @classmethod
241249 def get (
242250 cls ,
243251 * _ ,
244252 ** __ ,
245- ) -> typing .Generator [tuple [str , Self | None ], None , None ]:
253+ ) -> typing .Generator [tuple [str , Self | None ]]:
246254 raise NotImplementedError
247255
248256
@@ -309,7 +317,7 @@ def get(
309317 step : pydantic .NonNegativeInt ,
310318 spans : bool = False ,
311319 ** kwargs ,
312- ) -> typing .Generator [dict [str , dict [str , list [dict [str , float ]]]], None , None ]:
320+ ) -> typing .Generator [dict [str , dict [str , list [dict [str , float ]]]]]:
313321 """Retrieve tensor-metrics from the server for a given set of runs.
314322
315323 Parameters
0 commit comments