File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
services/api-server/src/simcore_service_api_server/models/domain Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff 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 [
Original file line number Diff line number Diff line change 3636class 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
You can’t perform that action at this time.
0 commit comments