Skip to content

Commit d2cf678

Browse files
committed
task_owner -> owner
1 parent 26abc99 commit d2cf678

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/service-library/src/servicelib/celery/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class TaskOwnerMetadata(BaseModel):
3636
class MyTaskFilter(TaskFilter):
3737
user_id: int | Wildcard
3838
product_name: int | Wildcard
39-
client_name: str
39+
owner: str
4040
41-
Listing tasks using the filter `MyTaskFilter(user_id=123, product_name=Wildcard(), client_name="my-app")` will return all tasks with
41+
Listing tasks using the filter `MyTaskFilter(user_id=123, product_name=Wildcard(), owner="my-app")` will return all tasks with
4242
user_id 123, any product_name submitted from my-app.
4343
4444
If the metadata schema is known, the class allows deserializing the metadata (recreate_as_model). I.e. one can recover the metadata from the task:
@@ -47,7 +47,7 @@ class MyTaskFilter(TaskFilter):
4747
"""
4848

4949
model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
50-
task_owner: Annotated[str, StringConstraints(min_length=1, pattern=r"^[a-z_-]+$")]
50+
owner: Annotated[str, StringConstraints(min_length=1, pattern=r"^[a-z_-]+$")]
5151

5252
@model_validator(mode="after")
5353
def _check_valid_filters(self) -> Self:

packages/service-library/tests/test_celery.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ class MyFilter(TaskOwnerMetadata):
9191
extra_field: str
9292

9393
with pytest.raises(pydantic.ValidationError):
94-
MyFilter(task_owner="", extra_field="value")
94+
MyFilter(owner="", extra_field="value")
9595

9696
with pytest.raises(pydantic.ValidationError):
97-
MyFilter(task_owner="UPPER_CASE", extra_field="value")
97+
MyFilter(owner="UPPER_CASE", extra_field="value")
9898

9999
class MyNextFilter(TaskOwnerMetadata):
100100
task_owner: Annotated[

services/api-server/src/simcore_service_api_server/models/domain/celery_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
class ApiWorkerTaskFilter(TaskOwnerMetadata):
3737
user_id: UserID
3838
product_name: ProductName
39-
task_owner: Annotated[
39+
owner: Annotated[
4040
str, StringConstraints(pattern=rf"^{APP_NAME}$"), Field(frozen=True)
4141
] = APP_NAME

0 commit comments

Comments
 (0)