Skip to content

Commit f6d3e2a

Browse files
committed
🐛 fix naming of job ID property
1 parent 55704e8 commit f6d3e2a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.pylintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ attr-naming-style=snake_case
419419
# Regular expression matching correct attribute names. Overrides attr-naming-
420420
# style. If left empty, attribute names will be checked with the set naming
421421
# style.
422-
#attr-rgx=
422+
attr-rgx=[a-z_][a-z0-9_]{1,30}$
423423

424424
# Bad variable names which should always be refused, separated by a comma.
425425
bad-names=foo,
@@ -489,7 +489,7 @@ good-names=i,
489489
good-names-rgxs=
490490

491491
# Include a hint for the correct naming format with invalid-name.
492-
include-naming-hint=no
492+
include-naming-hint=yes
493493

494494
# Naming style matching correct inline iteration names.
495495
inlinevar-naming-style=any

mindee/response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Job:
3737
Will hold information on the queue a document has been submitted to.
3838
"""
3939

40-
job_id: Optional[str] = None
40+
id: Optional[str] = None
4141
"""ID of the job sent by the API in response to an enqueue request."""
4242
issued_at: datetime
4343
"""Timestamp of the request reception by the API."""
@@ -57,7 +57,7 @@ def __init__(self, json_response: dict) -> None:
5757
self.issued_at = datetime.fromisoformat(json_response["issued_at"])
5858
if json_response.get("available_at"):
5959
self.available_at = datetime.fromisoformat(json_response["available_at"])
60-
self.job_id = json_response.get("id")
60+
self.id = json_response.get("id")
6161
self.status = json_response.get("status")
6262
if self.available_at:
6363
self.millisecs_taken = int(

tests/api/test_async_response.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_async_response_post_success(dummy_file_input, dummy_config):
5656
)
5757
assert parsed_response.job.available_at is None
5858
assert parsed_response.job.status == "waiting"
59-
assert parsed_response.job.job_id == "76c90710-3a1b-4b91-8a39-31a6543e347c"
59+
assert parsed_response.job.id == "76c90710-3a1b-4b91-8a39-31a6543e347c"
6060
assert not parsed_response.api_request.error
6161

6262

@@ -72,7 +72,7 @@ def test_async_response_post_fail(dummy_file_input, dummy_config):
7272
assert parsed_response.job.issued_at.isoformat() == "2023-01-01T00:00:00+00:00"
7373
assert parsed_response.job.available_at is None
7474
assert parsed_response.job.status is None
75-
assert parsed_response.job.job_id is None
75+
assert parsed_response.job.id is None
7676
assert parsed_response.api_request.error
7777
assert parsed_response.api_request.error["code"] == "Forbidden"
7878

@@ -89,7 +89,7 @@ def test_async_get_processing(dummy_file_input, dummy_config):
8989
assert parsed_response.job.issued_at.isoformat() == "2023-03-16T12:33:49.602947"
9090
assert parsed_response.job.available_at is None
9191
assert parsed_response.job.status == "processing"
92-
assert parsed_response.job.job_id == "76c90710-3a1b-4b91-8a39-31a6543e347c"
92+
assert parsed_response.job.id == "76c90710-3a1b-4b91-8a39-31a6543e347c"
9393
assert not parsed_response.api_request.error
9494

9595

0 commit comments

Comments
 (0)