File tree 3 files changed +15
-3
lines changed
3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -452,7 +452,7 @@ def get_tasks(
452
452
453
453
def get_tasks_count (
454
454
self ,
455
- project_name : str ,
455
+ project_name : str = None ,
456
456
batch_name : str = None ,
457
457
task_type : TaskType = None ,
458
458
status : TaskStatus = None ,
@@ -470,7 +470,7 @@ def get_tasks_count(
470
470
"""Returns number of tasks with given filters.
471
471
472
472
Args:
473
- project_name (str):
473
+ project_name (str, optional ):
474
474
Project Name
475
475
476
476
batch_name (str, optional):
@@ -529,6 +529,11 @@ def get_tasks_count(
529
529
Returns number of tasks
530
530
"""
531
531
532
+ if not project_name and not batch_name :
533
+ raise ValueError (
534
+ "At least one of project_name or batch_name must be provided."
535
+ )
536
+
532
537
tasks_args = self ._process_tasks_endpoint_args (
533
538
project_name ,
534
539
batch_name ,
Original file line number Diff line number Diff line change 1
- __version__ = "2.15.12 "
1
+ __version__ = "2.15.13 "
2
2
__package_name__ = "scaleapi"
Original file line number Diff line number Diff line change @@ -417,6 +417,13 @@ def test_get_tasks_count():
417
417
assert tasks_count == get_tasks_count
418
418
419
419
420
+ def test_get_tasks_count_with_only_batch ():
421
+ batch = create_a_batch ()
422
+ tasks_count = client .tasks (batch = batch .name ).total
423
+ get_tasks_count = client .get_tasks_count (batch_name = batch .name )
424
+ assert tasks_count == get_tasks_count
425
+
426
+
420
427
def test_finalize_batch ():
421
428
batch = create_a_batch ()
422
429
batch = client .finalize_batch (batch .name )
You can’t perform that action at this time.
0 commit comments