Skip to content

Commit 96361a8

Browse files
authored
Max results when parent job is specificed (#33830)
1 parent 4ecc31b commit 96361a8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_job_operations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,11 @@ def list(
287287

288288
schedule_defined = kwargs.pop("schedule_defined", None)
289289
scheduled_job_name = kwargs.pop("scheduled_job_name", None)
290+
max_results = kwargs.pop("max_results", None)
290291

291292
if parent_job_name:
292293
parent_job = self.get(parent_job_name)
293-
return self._runs_operations.get_run_children(parent_job.name)
294+
return self._runs_operations.get_run_children(parent_job.name, max_results=max_results)
294295

295296
return cast(
296297
Iterable[Job],

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_run_operations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ def get_run_details(self, run_id: str) -> RunDetails:
4444
run_id,
4545
)
4646

47-
def get_run_children(self, run_id: str) -> Iterable[_BaseJob]:
47+
def get_run_children(self, run_id: str, **kwargs) -> Iterable[_BaseJob]:
4848
return cast(
4949
Iterable[_BaseJob],
5050
self._operation.get_child(
5151
self._subscription_id,
5252
self._resource_group_name,
5353
self._workspace_name,
5454
run_id,
55+
top=kwargs.pop("max_results", None),
5556
cls=lambda objs: [self._translate_from_rest_object(obj) for obj in objs],
5657
),
5758
)

0 commit comments

Comments
 (0)