diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3bb7b03..384798f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: rev: 20.8b1 hooks: - id: black -- repo: https://gitlab.com/pycqa/flake8 +- repo: https://github.com/PyCQA/flake8 rev: 3.8.4 hooks: - id: flake8 diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index b3fc179..f0a14d9 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -689,6 +689,9 @@ def batches(self, **kwargs) -> Batchlist: The maximum value of `created_at` in UTC timezone ISO format: 'YYYY-MM-DD HH:MM:SS.mmmmmm' + exclude_archived (bool): + A flag to exclude archived batches if True + status (str): Status to filter batches by @@ -710,6 +713,7 @@ def batches(self, **kwargs) -> Batchlist: allowed_kwargs = { "start_time", "end_time", + "exclude_archived", "status", "project", "limit", @@ -739,6 +743,7 @@ def get_batches( batch_status: BatchStatus = None, created_after: str = None, created_before: str = None, + exclude_archived: bool = False, ) -> Generator[Batch, None, None]: """`Generator` method to yield all batches with the given parameters. @@ -761,6 +766,9 @@ def get_batches( The maximum value of `created_at` in UTC timezone ISO format: 'YYYY-MM-DD HH:MM:SS.mmmmmm' + exclude_archived (bool): + A flag to exclude archived batches if True + Yields: Generator[Batch]: Yields Batch, can be iterated. @@ -775,6 +783,7 @@ def get_batches( "end_time": created_before, "project": project_name, "offset": offset, + "exclude_archived": exclude_archived, } if batch_status: diff --git a/scaleapi/_version.py b/scaleapi/_version.py index 6875128..6984877 100644 --- a/scaleapi/_version.py +++ b/scaleapi/_version.py @@ -1,2 +1,2 @@ -__version__ = "2.14.1" +__version__ = "2.14.2" __package_name__ = "scaleapi"