From 1712171cdee94381f8890322cb999ab755202a5b Mon Sep 17 00:00:00 2001 From: Jake Herrmann Date: Mon, 22 Apr 2024 10:56:06 -0800 Subject: [PATCH 1/3] add priority --- src/hyp3_sdk/jobs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hyp3_sdk/jobs.py b/src/hyp3_sdk/jobs.py index 5a6a09d..3e11548 100644 --- a/src/hyp3_sdk/jobs.py +++ b/src/hyp3_sdk/jobs.py @@ -32,6 +32,7 @@ def __init__( expiration_time: Optional[datetime] = None, processing_times: Optional[List[float]] = None, credit_cost: Optional[float] = None, + priority: Optional[int] = None, ): self.job_id = job_id self.job_type = job_type @@ -47,6 +48,7 @@ def __init__( self.expiration_time = expiration_time self.processing_times = processing_times self.credit_cost = credit_cost + self.priority = priority def __repr__(self): return f'Job.from_dict({self.to_dict()})' @@ -75,6 +77,7 @@ def from_dict(input_dict: dict): expiration_time=expiration_time, processing_times=input_dict.get('processing_times'), credit_cost=input_dict.get('credit_cost'), + priority=input_dict.get('priority'), ) def to_dict(self, for_resubmit: bool = False): From df8ef8c865ee7c42c4045509a20ab18f087a1130 Mon Sep 17 00:00:00 2001 From: Jake Herrmann Date: Mon, 22 Apr 2024 11:08:44 -0800 Subject: [PATCH 2/3] update tests --- tests/conftest.py | 1 + tests/test_jobs.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index fdb2895..fa693da 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -22,6 +22,7 @@ def default_job( thumbnail_images=None, expiration_time=None, credit_cost=None, + priority=None, ): if job_parameters is None: job_parameters = {'param1': 'value1'} diff --git a/tests/test_jobs.py b/tests/test_jobs.py index 02c2640..e679e79 100644 --- a/tests/test_jobs.py +++ b/tests/test_jobs.py @@ -25,6 +25,7 @@ "thumbnail_images": ["https://PAIR_PROCESS_thumb.png"], "user_id": "asf_hyp3", "credit_cost": 1, + "priority": 9999, } FAILED_JOB = { @@ -42,6 +43,7 @@ "status_code": "FAILED", "user_id": "asf_hyp3", "credit_cost": 1, + "priority": 9999, } From 0acf3a1cfda1c6bce0530ce165587c993a750e7f Mon Sep 17 00:00:00 2001 From: Jake Herrmann Date: Mon, 22 Apr 2024 11:15:56 -0800 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bfd7a6..b8f866a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/) and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.2.0] + +### Added +* `Job.priority` attribute + ## [6.1.0] ### Added