Skip to content

Commit ba3544c

Browse files
authored
Merge pull request #154 from statisticsnorway/update-deps
Update dependencies
2 parents fa785a8 + ea4a5c5 commit ba3544c

File tree

12 files changed

+128
-150
lines changed

12 files changed

+128
-150
lines changed

job_executor/adapter/job_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ def get_jobs(
2727
if job_status is not None:
2828
query_fields.append(f"status={job_status}")
2929
if operations is not None:
30-
query_fields.append(f'operation={",".join(operations)}')
30+
query_fields.append(f"operation={','.join(operations)}")
3131
if ignore_completed is not None:
3232
query_fields.append(f"ignoreCompleted={str(ignore_completed).lower()}")
3333

3434
request_url = f"{JOB_SERVICE_URL}/jobs"
3535
if query_fields:
36-
request_url += f'?{"&".join(query_fields)}'
36+
request_url += f"?{'&'.join(query_fields)}"
3737

3838
response = execute_request("GET", request_url, True)
3939
return [Job(**job) for job in response.json()]

job_executor/app.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def fix_interrupted_jobs():
5959
def fix_interrupted_job(job):
6060
job_operation = job.parameters.operation
6161
logger.info(
62-
f"{job.job_id}: Rolling back job with operation " f'"{job_operation}"'
62+
f'{job.job_id}: Rolling back job with operation "{job_operation}"'
6363
)
6464
if job_operation in ["ADD", "CHANGE", "PATCH_METADATA"]:
6565
if job.status == "importing":
@@ -74,16 +74,14 @@ def fix_interrupted_job(job):
7474
job_service.update_job_status(
7575
job.job_id,
7676
"built",
77-
"Reset to built status will be due to "
78-
"unexpected interruption",
77+
"Reset to built status will be due to unexpected interruption",
7978
)
8079
else:
8180
rollback.rollback_worker_phase_import_job(
8281
job.job_id, job_operation, job.parameters.target
8382
)
8483
logger.info(
85-
f'{job.job_id}: Setting status to "failed" for '
86-
f"interrupted job"
84+
f'{job.job_id}: Setting status to "failed" for interrupted job'
8785
)
8886
job_service.update_job_status(
8987
job.job_id,
@@ -123,8 +121,7 @@ def fix_interrupted_job(job):
123121
)
124122
else:
125123
log_message = (
126-
f"Unrecognized job operation {job_operation}"
127-
f"for job {job.job_id}"
124+
f"Unrecognized job operation {job_operation}for job {job.job_id}"
128125
)
129126
logger.error(log_message)
130127
raise RollbackException(log_message)

job_executor/exception/__init__.py

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,43 @@
1-
class BuilderStepError(Exception):
2-
...
1+
class BuilderStepError(Exception): ...
32

43

5-
class HttpResponseError(Exception):
6-
...
4+
class HttpResponseError(Exception): ...
75

86

9-
class HttpRequestError(Exception):
10-
...
7+
class HttpRequestError(Exception): ...
118

129

13-
class VersioningException(Exception):
14-
...
10+
class VersioningException(Exception): ...
1511

1612

17-
class ReleaseStatusException(Exception):
18-
...
13+
class ReleaseStatusException(Exception): ...
1914

2015

21-
class NoSuchDraftException(Exception):
22-
...
16+
class NoSuchDraftException(Exception): ...
2317

2418

25-
class ExistingDraftException(Exception):
26-
...
19+
class ExistingDraftException(Exception): ...
2720

2821

29-
class UnknownOperationException(Exception):
30-
...
22+
class UnknownOperationException(Exception): ...
3123

3224

33-
class PatchingError(Exception):
34-
...
25+
class PatchingError(Exception): ...
3526

3627

37-
class MetadataException(Exception):
38-
...
28+
class MetadataException(Exception): ...
3929

4030

41-
class BumpException(Exception):
42-
...
31+
class BumpException(Exception): ...
4332

4433

45-
class LocalStorageError(Exception):
46-
...
34+
class LocalStorageError(Exception): ...
4735

4836

49-
class UnnecessaryUpdateException(Exception):
50-
...
37+
class UnnecessaryUpdateException(Exception): ...
5138

5239

53-
class StartupException(Exception):
54-
...
40+
class StartupException(Exception): ...
5541

5642

57-
class RollbackException(Exception):
58-
...
43+
class RollbackException(Exception): ...

job_executor/model/datastore.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ def _version_pending_operations(
385385
self._log(
386386
job_id, "Renaming data file and updating data_versions"
387387
)
388-
new_data_versions[
389-
dataset_name
390-
] = local_storage.rename_parquet_draft_to_release(
391-
dataset_name, new_version
388+
new_data_versions[dataset_name] = (
389+
local_storage.rename_parquet_draft_to_release(
390+
dataset_name, new_version
391+
)
392392
)
393393
return new_metadata_datasets, new_data_versions
394394

job_executor/model/datastore_version.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ def release_pending(self) -> Tuple[List[DataStructureUpdate], str]:
157157
return pending_updates, update_type
158158

159159
def _write_to_file(self):
160-
local_storage.write_draft_version(
161-
self.model_dump(by_alias=True)
162-
)
160+
local_storage.write_draft_version(self.model_dump(by_alias=True))
163161

164162
def set_draft_release_status(self, dataset_name: str, new_status: str):
165163
dataset_update = next(

job_executor/model/datastore_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def dotted_to_underscored_version(version: str) -> str:
9191

9292

9393
def underscored_to_dotted_version(version: str) -> str:
94-
return f'{version.replace("_", ".")}.0'
94+
return f"{version.replace('_', '.')}.0"
9595

9696

9797
def bump_dotted_version_number(version: str, update_type: str) -> str:

job_executor/model/metadata.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ def validate_patching_fields(
179179
message += f"shortName: {self.name} to {other.name}\n"
180180
if with_key_type and self.key_type.name != other.key_type.name:
181181
message += (
182-
f"unitType.name: {self.key_type.name} "
183-
f"to {other.key_type.name}"
182+
f"unitType.name: {self.key_type.name} to {other.key_type.name}"
184183
)
185184

186185
if message:
@@ -272,8 +271,7 @@ def patch(self, other: "Variable") -> "Variable":
272271
return Variable(**patched)
273272

274273

275-
class AttributeVariable(Variable):
276-
...
274+
class AttributeVariable(Variable): ...
277275

278276

279277
class TemporalEnd(CamelModel):

0 commit comments

Comments
 (0)