From b0158d3b68fb1810b07ea68d1f9795f3f107ff23 Mon Sep 17 00:00:00 2001 From: Collin Choy Date: Wed, 4 Sep 2024 17:57:30 -0400 Subject: [PATCH] Deployment.concurrency_limit cannot be zero. --- docs/3.0/api-ref/rest-api/server/schema.json | 4 ++-- src/prefect/server/schemas/actions.py | 4 ++-- src/prefect/server/schemas/core.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/3.0/api-ref/rest-api/server/schema.json b/docs/3.0/api-ref/rest-api/server/schema.json index 743c5f9a19fb..ab8b5fca075f 100644 --- a/docs/3.0/api-ref/rest-api/server/schema.json +++ b/docs/3.0/api-ref/rest-api/server/schema.json @@ -15755,7 +15755,7 @@ "anyOf": [ { "type": "integer", - "minimum": 0.0 + "exclusiveMinimum": 0.0 }, { "type": "null" @@ -16994,7 +16994,7 @@ "anyOf": [ { "type": "integer", - "minimum": 0.0 + "exclusiveMinimum": 0.0 }, { "type": "null" diff --git a/src/prefect/server/schemas/actions.py b/src/prefect/server/schemas/actions.py index 9ef0e06af9e6..66caafc32714 100644 --- a/src/prefect/server/schemas/actions.py +++ b/src/prefect/server/schemas/actions.py @@ -169,7 +169,7 @@ class DeploymentCreate(ActionBaseModel): default_factory=list, description="A list of schedules for the deployment.", ) - concurrency_limit: Optional[NonNegativeInteger] = Field( + concurrency_limit: Optional[PositiveInteger] = Field( default=None, description="The deployment's concurrency limit." ) enforce_parameter_schema: bool = Field( @@ -267,7 +267,7 @@ def remove_old_fields(cls, values): default_factory=list, description="A list of schedules for the deployment.", ) - concurrency_limit: Optional[NonNegativeInteger] = Field( + concurrency_limit: Optional[PositiveInteger] = Field( default=None, description="The deployment's concurrency limit." ) parameters: Optional[Dict[str, Any]] = Field( diff --git a/src/prefect/server/schemas/core.py b/src/prefect/server/schemas/core.py index b67379d0f638..2ecabb90a3d7 100644 --- a/src/prefect/server/schemas/core.py +++ b/src/prefect/server/schemas/core.py @@ -546,7 +546,7 @@ class Deployment(ORMBaseModel): schedules: List[DeploymentSchedule] = Field( default_factory=list, description="A list of schedules for the deployment." ) - concurrency_limit: Optional[NonNegativeInteger] = Field( + concurrency_limit: Optional[PositiveInteger] = Field( default=None, description="The concurrency limit for the deployment." ) job_variables: Dict[str, Any] = Field(