Skip to content

Commit 65bfed6

Browse files
exclude_archived param added to batches retrieval (#74)
* exclude_archived option added to batches retrieval * version bump * fix args * Update scaleapi/__init__.py Co-authored-by: Fatih Kurtoglu <fatih.kurtoglu@scale.com> * Update scaleapi/__init__.py Co-authored-by: Fatih Kurtoglu <fatih.kurtoglu@scale.com> --------- Co-authored-by: Fatih Kurtoglu <fatih.kurtoglu@scale.com>
1 parent 1aa9191 commit 65bfed6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
rev: 20.8b1
2222
hooks:
2323
- id: black
24-
- repo: https://gitlab.com/pycqa/flake8
24+
- repo: https://github.com/PyCQA/flake8
2525
rev: 3.8.4
2626
hooks:
2727
- id: flake8

scaleapi/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,9 @@ def batches(self, **kwargs) -> Batchlist:
689689
The maximum value of `created_at` in UTC timezone
690690
ISO format: 'YYYY-MM-DD HH:MM:SS.mmmmmm'
691691
692+
exclude_archived (bool):
693+
A flag to exclude archived batches if True
694+
692695
status (str):
693696
Status to filter batches by
694697
@@ -710,6 +713,7 @@ def batches(self, **kwargs) -> Batchlist:
710713
allowed_kwargs = {
711714
"start_time",
712715
"end_time",
716+
"exclude_archived",
713717
"status",
714718
"project",
715719
"limit",
@@ -739,6 +743,7 @@ def get_batches(
739743
batch_status: BatchStatus = None,
740744
created_after: str = None,
741745
created_before: str = None,
746+
exclude_archived: bool = False,
742747
) -> Generator[Batch, None, None]:
743748
"""`Generator` method to yield all batches with the given
744749
parameters.
@@ -761,6 +766,9 @@ def get_batches(
761766
The maximum value of `created_at` in UTC timezone
762767
ISO format: 'YYYY-MM-DD HH:MM:SS.mmmmmm'
763768
769+
exclude_archived (bool):
770+
A flag to exclude archived batches if True
771+
764772
Yields:
765773
Generator[Batch]:
766774
Yields Batch, can be iterated.
@@ -775,6 +783,7 @@ def get_batches(
775783
"end_time": created_before,
776784
"project": project_name,
777785
"offset": offset,
786+
"exclude_archived": exclude_archived,
778787
}
779788

780789
if batch_status:

0 commit comments

Comments
 (0)