Skip to content

Commit

Permalink
Add in a settings.experiments module (#15845)
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-phinizy authored Oct 29, 2024
1 parent 8768ffa commit 7f88577
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
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

0 comments on commit 7f88577

Please sign in to comment.