Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix phantom missing fields for triggers schemas #15792

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/prefect/events/schemas/automations.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,23 @@ class EventTrigger(ResourceTrigger):
),
)
posture: Literal[Posture.Reactive, Posture.Proactive] = Field( # type: ignore[valid-type]
Posture.Reactive,
default=Posture.Reactive,
description=(
"The posture of this trigger, either Reactive or Proactive. Reactive "
"triggers respond to the _presence_ of the expected events, while "
"Proactive triggers respond to the _absence_ of those expected events."
),
)
threshold: int = Field(
1,
default=1,
description=(
"The number of events required for this trigger to fire (for "
"Reactive triggers), or the number of events expected (for Proactive "
"triggers)"
),
)
within: timedelta = Field(
timedelta(seconds=0),
default=timedelta(seconds=0),
ge=timedelta(seconds=0),
description=(
"The time period over which the events must occur. For Reactive triggers, "
Expand Down
15 changes: 10 additions & 5 deletions src/prefect/events/schemas/deployment_triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,27 @@ class BaseDeploymentTrigger(PrefectBaseModel, abc.ABC, extra="ignore"): # type:
# Fields from Automation

name: Optional[str] = Field(
None, description="The name to give to the automation created for this trigger."
default=None,
description="The name to give to the automation created for this trigger.",
)
description: str = Field(
default="", description="A longer description of this automation"
)
enabled: bool = Field(
default=True, description="Whether this automation will be evaluated"
)
description: str = Field("", description="A longer description of this automation")
enabled: bool = Field(True, description="Whether this automation will be evaluated")

# Fields from the RunDeployment action

parameters: Optional[Dict[str, Any]] = Field(
None,
default=None,
description=(
"The parameters to pass to the deployment, or None to use the "
"deployment's default parameters"
),
)
job_variables: Optional[Dict[str, Any]] = Field(
None,
default=None,
description=(
"Job variables to pass to the deployment, or None to use the "
"deployment's default job variables"
Expand Down
Loading