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

Add in a settings.experiments module #15845

Merged
merged 3 commits into from
Oct 29, 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
10 changes: 10 additions & 0 deletions schemas/settings.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@
"title": "DeploymentsSettings",
"type": "object"
},
"ExperimentsSettings": {
"description": "Settings for configuring experimental features",
"properties": {},
"title": "ExperimentsSettings",
"type": "object"
},
"FlowsSettings": {
"description": "Settings for controlling flow behavior",
"properties": {
Expand Down Expand Up @@ -1571,6 +1577,10 @@
"deployments": {
"$ref": "#/$defs/DeploymentsSettings"
},
"experiments": {
"$ref": "#/$defs/ExperimentsSettings",
"description": "Settings for controlling experimental features"
},
"flows": {
"$ref": "#/$defs/FlowsSettings"
},
Expand Down
15 changes: 15 additions & 0 deletions src/prefect/settings/models/experiments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from prefect.settings.base import PrefectBaseSettings, PrefectSettingsConfigDict


class ExperimentsSettings(PrefectBaseSettings):
"""
Settings for configuring experimental features
"""

model_config = PrefectSettingsConfigDict(
env_prefix="PREFECT_EXPERIMENTS_",
env_file=".env",
extra="ignore",
toml_file="prefect.toml",
prefect_toml_table_header=("experiments",),
)
6 changes: 6 additions & 0 deletions src/prefect/settings/models/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from .client import ClientSettings
from .cloud import CloudSettings
from .deployments import DeploymentsSettings
from .experiments import ExperimentsSettings
from .flows import FlowsSettings
from .internal import InternalSettings
from .logging import LoggingSettings
Expand Down Expand Up @@ -89,6 +90,11 @@ class Settings(PrefectBaseSettings):
description="Settings for configuring deployments defaults",
)

experiments: ExperimentsSettings = Field(
default_factory=ExperimentsSettings,
description="Settings for controlling experimental features",
)

flows: FlowsSettings = Field(
default_factory=FlowsSettings,
description="Settings for controlling flow behavior",
Expand Down