prefect-client 3.0.11__py3-none-any.whl → 3.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- prefect/_version.py +3 -3
- prefect/cache_policies.py +4 -4
- prefect/client/orchestration.py +25 -3
- prefect/client/schemas/actions.py +11 -18
- prefect/client/schemas/objects.py +17 -27
- prefect/context.py +6 -2
- prefect/deployments/base.py +0 -2
- prefect/deployments/schedules.py +0 -4
- prefect/logging/logging.yml +4 -0
- prefect/results.py +27 -17
- prefect/settings/base.py +65 -3
- prefect/settings/legacy.py +1 -1
- prefect/settings/models/api.py +5 -5
- prefect/settings/models/cli.py +5 -5
- prefect/settings/models/client.py +6 -8
- prefect/settings/models/cloud.py +5 -5
- prefect/settings/models/deployments.py +2 -5
- prefect/settings/models/experiments.py +24 -0
- prefect/settings/models/flows.py +2 -5
- prefect/settings/models/internal.py +2 -5
- prefect/settings/models/logging.py +3 -8
- prefect/settings/models/results.py +2 -5
- prefect/settings/models/root.py +34 -34
- prefect/settings/models/runner.py +3 -8
- prefect/settings/models/server/api.py +2 -5
- prefect/settings/models/server/database.py +2 -7
- prefect/settings/models/server/deployments.py +2 -5
- prefect/settings/models/server/ephemeral.py +2 -5
- prefect/settings/models/server/events.py +2 -5
- prefect/settings/models/server/flow_run_graph.py +2 -5
- prefect/settings/models/server/root.py +2 -5
- prefect/settings/models/server/services.py +13 -44
- prefect/settings/models/server/tasks.py +3 -12
- prefect/settings/models/server/ui.py +2 -5
- prefect/settings/models/tasks.py +10 -11
- prefect/settings/models/testing.py +2 -5
- prefect/settings/models/worker.py +3 -8
- prefect/settings/sources.py +74 -1
- prefect/states.py +22 -21
- prefect/task_engine.py +30 -11
- prefect/utilities/hashing.py +7 -3
- prefect/workers/base.py +36 -5
- {prefect_client-3.0.11.dist-info → prefect_client-3.1.0.dist-info}/METADATA +2 -2
- {prefect_client-3.0.11.dist-info → prefect_client-3.1.0.dist-info}/RECORD +47 -47
- prefect/settings/models/ui.py +0 -0
- {prefect_client-3.0.11.dist-info → prefect_client-3.1.0.dist-info}/LICENSE +0 -0
- {prefect_client-3.0.11.dist-info → prefect_client-3.1.0.dist-info}/WHEEL +0 -0
- {prefect_client-3.0.11.dist-info → prefect_client-3.1.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
from pydantic import AliasChoices, AliasPath, Field
|
2
|
+
|
3
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
4
|
+
|
5
|
+
|
6
|
+
class ExperimentsSettings(PrefectBaseSettings):
|
7
|
+
"""
|
8
|
+
Settings for configuring experimental features
|
9
|
+
"""
|
10
|
+
|
11
|
+
model_config = _build_settings_config(("experiments",))
|
12
|
+
|
13
|
+
warn: bool = Field(
|
14
|
+
default=True,
|
15
|
+
description="If `True`, warn on usage of experimental features.",
|
16
|
+
validation_alias=AliasChoices(
|
17
|
+
AliasPath("warn"), "prefect_experiments_warn", "prefect_experimental_warn"
|
18
|
+
),
|
19
|
+
)
|
20
|
+
|
21
|
+
worker_logging_to_api_enabled: bool = Field(
|
22
|
+
default=False,
|
23
|
+
description="Enables the logging of worker logs to Prefect Cloud.",
|
24
|
+
)
|
prefect/settings/models/flows.py
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
from typing import Union
|
2
2
|
|
3
3
|
from pydantic import AliasChoices, AliasPath, Field
|
4
|
-
from pydantic_settings import SettingsConfigDict
|
5
4
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings
|
5
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
7
6
|
|
8
7
|
|
9
8
|
class FlowsSettings(PrefectBaseSettings):
|
@@ -11,9 +10,7 @@ class FlowsSettings(PrefectBaseSettings):
|
|
11
10
|
Settings for controlling flow behavior
|
12
11
|
"""
|
13
12
|
|
14
|
-
model_config =
|
15
|
-
env_prefix="PREFECT_FLOWS_", env_file=".env", extra="ignore"
|
16
|
-
)
|
13
|
+
model_config = _build_settings_config(("flows",))
|
17
14
|
|
18
15
|
default_retries: int = Field(
|
19
16
|
default=0,
|
@@ -1,14 +1,11 @@
|
|
1
1
|
from pydantic import AliasChoices, AliasPath, Field
|
2
|
-
from pydantic_settings import SettingsConfigDict
|
3
2
|
|
4
|
-
from prefect.settings.base import PrefectBaseSettings
|
3
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
5
4
|
from prefect.types import LogLevel
|
6
5
|
|
7
6
|
|
8
7
|
class InternalSettings(PrefectBaseSettings):
|
9
|
-
model_config =
|
10
|
-
env_prefix="PREFECT_INTERNAL_", env_file=".env", extra="ignore"
|
11
|
-
)
|
8
|
+
model_config = _build_settings_config(("internal",))
|
12
9
|
|
13
10
|
logging_level: LogLevel = Field(
|
14
11
|
default="ERROR",
|
@@ -2,10 +2,9 @@ from pathlib import Path
|
|
2
2
|
from typing import Annotated, Literal, Optional, Union
|
3
3
|
|
4
4
|
from pydantic import AfterValidator, AliasChoices, AliasPath, Field, model_validator
|
5
|
-
from pydantic_settings import SettingsConfigDict
|
6
5
|
from typing_extensions import Self
|
7
6
|
|
8
|
-
from prefect.settings.base import PrefectBaseSettings
|
7
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
9
8
|
from prefect.types import LogLevel
|
10
9
|
|
11
10
|
|
@@ -26,9 +25,7 @@ class LoggingToAPISettings(PrefectBaseSettings):
|
|
26
25
|
Settings for controlling logging to the API
|
27
26
|
"""
|
28
27
|
|
29
|
-
model_config =
|
30
|
-
env_prefix="PREFECT_LOGGING_TO_API_", env_file=".env", extra="ignore"
|
31
|
-
)
|
28
|
+
model_config = _build_settings_config(("logging", "to_api"))
|
32
29
|
|
33
30
|
enabled: bool = Field(
|
34
31
|
default=True,
|
@@ -81,9 +78,7 @@ class LoggingSettings(PrefectBaseSettings):
|
|
81
78
|
Settings for controlling logging behavior
|
82
79
|
"""
|
83
80
|
|
84
|
-
model_config =
|
85
|
-
env_prefix="PREFECT_LOGGING_", env_file=".env", extra="ignore"
|
86
|
-
)
|
81
|
+
model_config = _build_settings_config(("logging",))
|
87
82
|
|
88
83
|
level: LogLevel = Field(
|
89
84
|
default="INFO",
|
@@ -2,9 +2,8 @@ from pathlib import Path
|
|
2
2
|
from typing import Optional
|
3
3
|
|
4
4
|
from pydantic import AliasChoices, AliasPath, Field
|
5
|
-
from pydantic_settings import SettingsConfigDict
|
6
5
|
|
7
|
-
from prefect.settings.base import PrefectBaseSettings
|
6
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
8
7
|
|
9
8
|
|
10
9
|
class ResultsSettings(PrefectBaseSettings):
|
@@ -12,9 +11,7 @@ class ResultsSettings(PrefectBaseSettings):
|
|
12
11
|
Settings for controlling result storage behavior
|
13
12
|
"""
|
14
13
|
|
15
|
-
model_config =
|
16
|
-
env_prefix="PREFECT_RESULTS_", env_file=".env", extra="ignore"
|
17
|
-
)
|
14
|
+
model_config = _build_settings_config(("results",))
|
18
15
|
|
19
16
|
default_serializer: str = Field(
|
20
17
|
default="pickle",
|
prefect/settings/models/root.py
CHANGED
@@ -11,10 +11,9 @@ from typing import (
|
|
11
11
|
from urllib.parse import urlparse
|
12
12
|
|
13
13
|
from pydantic import BeforeValidator, Field, SecretStr, model_validator
|
14
|
-
from pydantic_settings import SettingsConfigDict
|
15
14
|
from typing_extensions import Self
|
16
15
|
|
17
|
-
from prefect.settings.base import PrefectBaseSettings
|
16
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
18
17
|
from prefect.settings.models.tasks import TasksSettings
|
19
18
|
from prefect.settings.models.testing import TestingSettings
|
20
19
|
from prefect.settings.models.worker import WorkerSettings
|
@@ -25,6 +24,7 @@ from .cli import CLISettings
|
|
25
24
|
from .client import ClientSettings
|
26
25
|
from .cloud import CloudSettings
|
27
26
|
from .deployments import DeploymentsSettings
|
27
|
+
from .experiments import ExperimentsSettings
|
28
28
|
from .flows import FlowsSettings
|
29
29
|
from .internal import InternalSettings
|
30
30
|
from .logging import LoggingSettings
|
@@ -43,12 +43,7 @@ class Settings(PrefectBaseSettings):
|
|
43
43
|
See https://docs.pydantic.dev/latest/concepts/pydantic_settings
|
44
44
|
"""
|
45
45
|
|
46
|
-
model_config =
|
47
|
-
env_file=".env",
|
48
|
-
env_prefix="PREFECT_",
|
49
|
-
env_nested_delimiter=None,
|
50
|
-
extra="ignore",
|
51
|
-
)
|
46
|
+
model_config = _build_settings_config()
|
52
47
|
|
53
48
|
home: Annotated[Path, BeforeValidator(lambda x: Path(x).expanduser())] = Field(
|
54
49
|
default=Path("~") / ".prefect",
|
@@ -90,6 +85,11 @@ class Settings(PrefectBaseSettings):
|
|
90
85
|
description="Settings for configuring deployments defaults",
|
91
86
|
)
|
92
87
|
|
88
|
+
experiments: ExperimentsSettings = Field(
|
89
|
+
default_factory=ExperimentsSettings,
|
90
|
+
description="Settings for controlling experimental features",
|
91
|
+
)
|
92
|
+
|
93
93
|
flows: FlowsSettings = Field(
|
94
94
|
default_factory=FlowsSettings,
|
95
95
|
description="Settings for controlling flow behavior",
|
@@ -149,30 +149,6 @@ class Settings(PrefectBaseSettings):
|
|
149
149
|
""",
|
150
150
|
)
|
151
151
|
|
152
|
-
experimental_warn: bool = Field(
|
153
|
-
default=True,
|
154
|
-
description="If `True`, warn on usage of experimental features.",
|
155
|
-
)
|
156
|
-
|
157
|
-
# this setting needs to be removed
|
158
|
-
async_fetch_state_result: bool = Field(
|
159
|
-
default=False,
|
160
|
-
description="""
|
161
|
-
Determines whether `State.result()` fetches results automatically or not.
|
162
|
-
In Prefect 2.6.0, the `State.result()` method was updated to be async
|
163
|
-
to facilitate automatic retrieval of results from storage which means when
|
164
|
-
writing async code you must `await` the call. For backwards compatibility,
|
165
|
-
the result is not retrieved by default for async users. You may opt into this
|
166
|
-
per call by passing `fetch=True` or toggle this setting to change the behavior
|
167
|
-
globally.
|
168
|
-
""",
|
169
|
-
)
|
170
|
-
|
171
|
-
experimental_enable_schedule_concurrency: bool = Field(
|
172
|
-
default=False,
|
173
|
-
description="Whether or not to enable concurrency for scheduled tasks.",
|
174
|
-
)
|
175
|
-
|
176
152
|
###########################################################################
|
177
153
|
# allow deprecated access to PREFECT_SOME_SETTING_NAME
|
178
154
|
|
@@ -295,9 +271,32 @@ class Settings(PrefectBaseSettings):
|
|
295
271
|
Returns:
|
296
272
|
A new Settings object.
|
297
273
|
"""
|
274
|
+
# To restore defaults, we need to resolve the setting path and then
|
275
|
+
# set the default value on the new settings object. When restoring
|
276
|
+
# defaults, all settings sources will be ignored.
|
298
277
|
restore_defaults_obj = {}
|
299
278
|
for r in restore_defaults or []:
|
300
|
-
|
279
|
+
path = r.accessor.split(".")
|
280
|
+
model = self
|
281
|
+
for key in path[:-1]:
|
282
|
+
model = model.model_fields[key].annotation
|
283
|
+
assert model is not None, f"Invalid setting path: {r.accessor}"
|
284
|
+
|
285
|
+
model_field = model.model_fields[path[-1]]
|
286
|
+
assert model is not None, f"Invalid setting path: {r.accessor}"
|
287
|
+
if hasattr(model_field, "default"):
|
288
|
+
default = model_field.default
|
289
|
+
elif (
|
290
|
+
hasattr(model_field, "default_factory") and model_field.default_factory
|
291
|
+
):
|
292
|
+
default = model_field.default_factory()
|
293
|
+
else:
|
294
|
+
raise ValueError(f"No default value for setting: {r.accessor}")
|
295
|
+
set_in_dict(
|
296
|
+
restore_defaults_obj,
|
297
|
+
r.accessor,
|
298
|
+
default,
|
299
|
+
)
|
301
300
|
updates = updates or {}
|
302
301
|
set_defaults = set_defaults or {}
|
303
302
|
|
@@ -312,7 +311,8 @@ class Settings(PrefectBaseSettings):
|
|
312
311
|
new_settings = self.__class__.model_validate(
|
313
312
|
deep_merge_dicts(
|
314
313
|
set_defaults_obj,
|
315
|
-
self.model_dump(exclude_unset=True
|
314
|
+
self.model_dump(exclude_unset=True),
|
315
|
+
restore_defaults_obj,
|
316
316
|
updates_obj,
|
317
317
|
)
|
318
318
|
)
|
@@ -1,7 +1,6 @@
|
|
1
1
|
from pydantic import Field
|
2
|
-
from pydantic_settings import SettingsConfigDict
|
3
2
|
|
4
|
-
from prefect.settings.base import PrefectBaseSettings
|
3
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
5
4
|
from prefect.types import LogLevel
|
6
5
|
|
7
6
|
|
@@ -10,9 +9,7 @@ class RunnerServerSettings(PrefectBaseSettings):
|
|
10
9
|
Settings for controlling runner server behavior
|
11
10
|
"""
|
12
11
|
|
13
|
-
model_config =
|
14
|
-
env_prefix="PREFECT_RUNNER_SERVER_", env_file=".env", extra="ignore"
|
15
|
-
)
|
12
|
+
model_config = _build_settings_config(("runner", "server"))
|
16
13
|
|
17
14
|
enable: bool = Field(
|
18
15
|
default=False,
|
@@ -45,9 +42,7 @@ class RunnerSettings(PrefectBaseSettings):
|
|
45
42
|
Settings for controlling runner behavior
|
46
43
|
"""
|
47
44
|
|
48
|
-
model_config =
|
49
|
-
env_prefix="PREFECT_RUNNER_", env_file=".env", extra="ignore"
|
50
|
-
)
|
45
|
+
model_config = _build_settings_config(("runner",))
|
51
46
|
|
52
47
|
process_limit: int = Field(
|
53
48
|
default=5,
|
@@ -1,9 +1,8 @@
|
|
1
1
|
from datetime import timedelta
|
2
2
|
|
3
3
|
from pydantic import AliasChoices, AliasPath, Field
|
4
|
-
from pydantic_settings import SettingsConfigDict
|
5
4
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings
|
5
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
7
6
|
|
8
7
|
|
9
8
|
class ServerAPISettings(PrefectBaseSettings):
|
@@ -11,9 +10,7 @@ class ServerAPISettings(PrefectBaseSettings):
|
|
11
10
|
Settings for controlling API server behavior
|
12
11
|
"""
|
13
12
|
|
14
|
-
model_config =
|
15
|
-
env_prefix="PREFECT_SERVER_API_", env_file=".env", extra="ignore"
|
16
|
-
)
|
13
|
+
model_config = _build_settings_config(("server", "api"))
|
17
14
|
|
18
15
|
host: str = Field(
|
19
16
|
default="127.0.0.1",
|
@@ -3,10 +3,9 @@ from typing import Optional
|
|
3
3
|
from urllib.parse import quote_plus
|
4
4
|
|
5
5
|
from pydantic import AliasChoices, AliasPath, Field, SecretStr, model_validator
|
6
|
-
from pydantic_settings import SettingsConfigDict
|
7
6
|
from typing_extensions import Literal, Self
|
8
7
|
|
9
|
-
from prefect.settings.base import PrefectBaseSettings
|
8
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
10
9
|
|
11
10
|
|
12
11
|
class ServerDatabaseSettings(PrefectBaseSettings):
|
@@ -14,11 +13,7 @@ class ServerDatabaseSettings(PrefectBaseSettings):
|
|
14
13
|
Settings for controlling server database behavior
|
15
14
|
"""
|
16
15
|
|
17
|
-
model_config =
|
18
|
-
env_prefix="PREFECT_SERVER_DATABASE_",
|
19
|
-
env_file=".env",
|
20
|
-
extra="ignore",
|
21
|
-
)
|
16
|
+
model_config = _build_settings_config(("server", "database"))
|
22
17
|
|
23
18
|
connection_url: Optional[SecretStr] = Field(
|
24
19
|
default=None,
|
@@ -1,13 +1,10 @@
|
|
1
1
|
from pydantic import AliasChoices, AliasPath, Field
|
2
|
-
from pydantic_settings import SettingsConfigDict
|
3
2
|
|
4
|
-
from prefect.settings.base import PrefectBaseSettings
|
3
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
5
4
|
|
6
5
|
|
7
6
|
class ServerDeploymentsSettings(PrefectBaseSettings):
|
8
|
-
model_config =
|
9
|
-
env_prefix="PREFECT_SERVER_DEPLOYMENTS_", env_file=".env", extra="ignore"
|
10
|
-
)
|
7
|
+
model_config = _build_settings_config(("server", "deployments"))
|
11
8
|
|
12
9
|
concurrency_slot_wait_seconds: float = Field(
|
13
10
|
default=30.0,
|
@@ -1,7 +1,6 @@
|
|
1
1
|
from pydantic import AliasChoices, AliasPath, Field
|
2
|
-
from pydantic_settings import SettingsConfigDict
|
3
2
|
|
4
|
-
from prefect.settings.base import PrefectBaseSettings
|
3
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
5
4
|
|
6
5
|
|
7
6
|
class ServerEphemeralSettings(PrefectBaseSettings):
|
@@ -9,9 +8,7 @@ class ServerEphemeralSettings(PrefectBaseSettings):
|
|
9
8
|
Settings for controlling ephemeral server behavior
|
10
9
|
"""
|
11
10
|
|
12
|
-
model_config =
|
13
|
-
env_prefix="PREFECT_SERVER_EPHEMERAL_", env_file=".env", extra="ignore"
|
14
|
-
)
|
11
|
+
model_config = _build_settings_config(("server", "ephemeral"))
|
15
12
|
|
16
13
|
enabled: bool = Field(
|
17
14
|
default=False,
|
@@ -1,9 +1,8 @@
|
|
1
1
|
from datetime import timedelta
|
2
2
|
|
3
3
|
from pydantic import AliasChoices, AliasPath, Field
|
4
|
-
from pydantic_settings import SettingsConfigDict
|
5
4
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings
|
5
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
7
6
|
|
8
7
|
|
9
8
|
class ServerEventsSettings(PrefectBaseSettings):
|
@@ -11,9 +10,7 @@ class ServerEventsSettings(PrefectBaseSettings):
|
|
11
10
|
Settings for controlling behavior of the events subsystem
|
12
11
|
"""
|
13
12
|
|
14
|
-
model_config =
|
15
|
-
env_prefix="PREFECT_SERVER_EVENTS_", env_file=".env", extra="ignore"
|
16
|
-
)
|
13
|
+
model_config = _build_settings_config(("server", "events"))
|
17
14
|
|
18
15
|
###########################################################################
|
19
16
|
# Events settings
|
@@ -1,7 +1,6 @@
|
|
1
1
|
from pydantic import AliasChoices, AliasPath, Field
|
2
|
-
from pydantic_settings import SettingsConfigDict
|
3
2
|
|
4
|
-
from prefect.settings.base import PrefectBaseSettings
|
3
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
5
4
|
|
6
5
|
|
7
6
|
class ServerFlowRunGraphSettings(PrefectBaseSettings):
|
@@ -9,9 +8,7 @@ class ServerFlowRunGraphSettings(PrefectBaseSettings):
|
|
9
8
|
Settings for controlling behavior of the flow run graph
|
10
9
|
"""
|
11
10
|
|
12
|
-
model_config =
|
13
|
-
env_prefix="PREFECT_SERVER_FLOW_RUN_GRAPH_", env_file=".env", extra="ignore"
|
14
|
-
)
|
11
|
+
model_config = _build_settings_config(("server", "flow_run_graph"))
|
15
12
|
|
16
13
|
max_nodes: int = Field(
|
17
14
|
default=10000,
|
@@ -2,9 +2,8 @@ from pathlib import Path
|
|
2
2
|
from typing import Optional
|
3
3
|
|
4
4
|
from pydantic import AliasChoices, AliasPath, Field
|
5
|
-
from pydantic_settings import SettingsConfigDict
|
6
5
|
|
7
|
-
from prefect.settings.base import PrefectBaseSettings
|
6
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
8
7
|
from prefect.types import LogLevel
|
9
8
|
|
10
9
|
from .api import ServerAPISettings
|
@@ -23,9 +22,7 @@ class ServerSettings(PrefectBaseSettings):
|
|
23
22
|
Settings for controlling server behavior
|
24
23
|
"""
|
25
24
|
|
26
|
-
model_config =
|
27
|
-
env_prefix="PREFECT_SERVER_", env_file=".env", extra="ignore"
|
28
|
-
)
|
25
|
+
model_config = _build_settings_config(("server",))
|
29
26
|
|
30
27
|
logging_level: LogLevel = Field(
|
31
28
|
default="WARNING",
|
@@ -1,9 +1,8 @@
|
|
1
1
|
from datetime import timedelta
|
2
2
|
|
3
3
|
from pydantic import AliasChoices, AliasPath, Field
|
4
|
-
from pydantic_settings import SettingsConfigDict
|
5
4
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings
|
5
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
7
6
|
|
8
7
|
|
9
8
|
class ServerServicesCancellationCleanupSettings(PrefectBaseSettings):
|
@@ -11,10 +10,8 @@ class ServerServicesCancellationCleanupSettings(PrefectBaseSettings):
|
|
11
10
|
Settings for controlling the cancellation cleanup service
|
12
11
|
"""
|
13
12
|
|
14
|
-
model_config =
|
15
|
-
|
16
|
-
env_file=".env",
|
17
|
-
extra="ignore",
|
13
|
+
model_config = _build_settings_config(
|
14
|
+
("server", "services", "cancellation_cleanup")
|
18
15
|
)
|
19
16
|
|
20
17
|
enabled: bool = Field(
|
@@ -43,11 +40,7 @@ class ServerServicesEventPersisterSettings(PrefectBaseSettings):
|
|
43
40
|
Settings for controlling the event persister service
|
44
41
|
"""
|
45
42
|
|
46
|
-
model_config =
|
47
|
-
env_prefix="PREFECT_SERVER_SERVICES_EVENT_PERSISTER_",
|
48
|
-
env_file=".env",
|
49
|
-
extra="ignore",
|
50
|
-
)
|
43
|
+
model_config = _build_settings_config(("server", "services", "event_persister"))
|
51
44
|
|
52
45
|
enabled: bool = Field(
|
53
46
|
default=True,
|
@@ -87,10 +80,8 @@ class ServerServicesFlowRunNotificationsSettings(PrefectBaseSettings):
|
|
87
80
|
Settings for controlling the flow run notifications service
|
88
81
|
"""
|
89
82
|
|
90
|
-
model_config =
|
91
|
-
|
92
|
-
env_file=".env",
|
93
|
-
extra="ignore",
|
83
|
+
model_config = _build_settings_config(
|
84
|
+
("server", "services", "flow_run_notifications")
|
94
85
|
)
|
95
86
|
|
96
87
|
enabled: bool = Field(
|
@@ -109,11 +100,7 @@ class ServerServicesForemanSettings(PrefectBaseSettings):
|
|
109
100
|
Settings for controlling the foreman service
|
110
101
|
"""
|
111
102
|
|
112
|
-
model_config =
|
113
|
-
env_prefix="PREFECT_SERVER_SERVICES_FOREMAN_",
|
114
|
-
env_file=".env",
|
115
|
-
extra="ignore",
|
116
|
-
)
|
103
|
+
model_config = _build_settings_config(("server", "services", "foreman"))
|
117
104
|
|
118
105
|
enabled: bool = Field(
|
119
106
|
default=True,
|
@@ -192,9 +179,7 @@ class ServerServicesLateRunsSettings(PrefectBaseSettings):
|
|
192
179
|
Settings for controlling the late runs service
|
193
180
|
"""
|
194
181
|
|
195
|
-
model_config =
|
196
|
-
env_prefix="PREFECT_SERVER_SERVICES_LATE_RUNS_", env_file=".env", extra="ignore"
|
197
|
-
)
|
182
|
+
model_config = _build_settings_config(("server", "services", "late_runs"))
|
198
183
|
|
199
184
|
enabled: bool = Field(
|
200
185
|
default=True,
|
@@ -236,9 +221,7 @@ class ServerServicesSchedulerSettings(PrefectBaseSettings):
|
|
236
221
|
Settings for controlling the scheduler service
|
237
222
|
"""
|
238
223
|
|
239
|
-
model_config =
|
240
|
-
env_prefix="PREFECT_SERVER_SERVICES_SCHEDULER_", env_file=".env", extra="ignore"
|
241
|
-
)
|
224
|
+
model_config = _build_settings_config(("server", "services", "scheduler"))
|
242
225
|
|
243
226
|
enabled: bool = Field(
|
244
227
|
default=True,
|
@@ -361,11 +344,7 @@ class ServerServicesPauseExpirationsSettings(PrefectBaseSettings):
|
|
361
344
|
Settings for controlling the pause expiration service
|
362
345
|
"""
|
363
346
|
|
364
|
-
model_config =
|
365
|
-
env_prefix="PREFECT_SERVER_SERVICES_PAUSE_EXPIRATIONS_",
|
366
|
-
env_file=".env",
|
367
|
-
extra="ignore",
|
368
|
-
)
|
347
|
+
model_config = _build_settings_config(("server", "services", "pause_expirations"))
|
369
348
|
|
370
349
|
enabled: bool = Field(
|
371
350
|
default=True,
|
@@ -399,11 +378,7 @@ class ServerServicesTaskRunRecorderSettings(PrefectBaseSettings):
|
|
399
378
|
Settings for controlling the task run recorder service
|
400
379
|
"""
|
401
380
|
|
402
|
-
model_config =
|
403
|
-
env_prefix="PREFECT_SERVER_SERVICES_TASK_RUN_RECORDER_",
|
404
|
-
env_file=".env",
|
405
|
-
extra="ignore",
|
406
|
-
)
|
381
|
+
model_config = _build_settings_config(("server", "services", "task_run_recorder"))
|
407
382
|
|
408
383
|
enabled: bool = Field(
|
409
384
|
default=True,
|
@@ -421,11 +396,7 @@ class ServerServicesTriggersSettings(PrefectBaseSettings):
|
|
421
396
|
Settings for controlling the triggers service
|
422
397
|
"""
|
423
398
|
|
424
|
-
model_config =
|
425
|
-
env_prefix="PREFECT_SERVER_SERVICES_TRIGGERS_",
|
426
|
-
env_file=".env",
|
427
|
-
extra="ignore",
|
428
|
-
)
|
399
|
+
model_config = _build_settings_config(("server", "services", "triggers"))
|
429
400
|
|
430
401
|
enabled: bool = Field(
|
431
402
|
default=True,
|
@@ -443,9 +414,7 @@ class ServerServicesSettings(PrefectBaseSettings):
|
|
443
414
|
Settings for controlling server services
|
444
415
|
"""
|
445
416
|
|
446
|
-
model_config =
|
447
|
-
env_prefix="PREFECT_SERVER_SERVICES_", env_file=".env", extra="ignore"
|
448
|
-
)
|
417
|
+
model_config = _build_settings_config(("server", "services"))
|
449
418
|
|
450
419
|
cancellation_cleanup: ServerServicesCancellationCleanupSettings = Field(
|
451
420
|
default_factory=ServerServicesCancellationCleanupSettings,
|
@@ -1,9 +1,8 @@
|
|
1
1
|
from datetime import timedelta
|
2
2
|
|
3
3
|
from pydantic import AliasChoices, AliasPath, Field
|
4
|
-
from pydantic_settings import SettingsConfigDict
|
5
4
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings
|
5
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
7
6
|
|
8
7
|
|
9
8
|
class ServerTasksSchedulingSettings(PrefectBaseSettings):
|
@@ -11,11 +10,7 @@ class ServerTasksSchedulingSettings(PrefectBaseSettings):
|
|
11
10
|
Settings for controlling server-side behavior related to task scheduling
|
12
11
|
"""
|
13
12
|
|
14
|
-
model_config =
|
15
|
-
env_file=".env",
|
16
|
-
env_prefix="PREFECT_SERVER_TASKS_SCHEDULING_",
|
17
|
-
extra="ignore",
|
18
|
-
)
|
13
|
+
model_config = _build_settings_config(("server", "tasks", "scheduling"))
|
19
14
|
|
20
15
|
max_scheduled_queue_size: int = Field(
|
21
16
|
default=1000,
|
@@ -53,11 +48,7 @@ class ServerTasksSettings(PrefectBaseSettings):
|
|
53
48
|
Settings for controlling server-side behavior related to tasks
|
54
49
|
"""
|
55
50
|
|
56
|
-
model_config =
|
57
|
-
env_file=".env",
|
58
|
-
env_prefix="PREFECT_SERVER_TASKS_",
|
59
|
-
extra="ignore",
|
60
|
-
)
|
51
|
+
model_config = _build_settings_config(("server", "tasks"))
|
61
52
|
|
62
53
|
tag_concurrency_slot_wait_seconds: float = Field(
|
63
54
|
default=30,
|
@@ -1,15 +1,12 @@
|
|
1
1
|
from typing import Optional
|
2
2
|
|
3
3
|
from pydantic import AliasChoices, AliasPath, Field
|
4
|
-
from pydantic_settings import SettingsConfigDict
|
5
4
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings
|
5
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
7
6
|
|
8
7
|
|
9
8
|
class ServerUISettings(PrefectBaseSettings):
|
10
|
-
model_config =
|
11
|
-
env_prefix="PREFECT_SERVER_UI_", env_file=".env", extra="ignore"
|
12
|
-
)
|
9
|
+
model_config = _build_settings_config(("server", "ui"))
|
13
10
|
|
14
11
|
enabled: bool = Field(
|
15
12
|
default=True,
|
prefect/settings/models/tasks.py
CHANGED
@@ -1,15 +1,12 @@
|
|
1
1
|
from typing import Optional, Union
|
2
2
|
|
3
3
|
from pydantic import AliasChoices, AliasPath, Field
|
4
|
-
from pydantic_settings import SettingsConfigDict
|
5
4
|
|
6
|
-
from prefect.settings.base import PrefectBaseSettings
|
5
|
+
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
7
6
|
|
8
7
|
|
9
8
|
class TasksRunnerSettings(PrefectBaseSettings):
|
10
|
-
model_config =
|
11
|
-
env_prefix="PREFECT_TASKS_RUNNER_", env_file=".env", extra="ignore"
|
12
|
-
)
|
9
|
+
model_config = _build_settings_config(("tasks", "runner"))
|
13
10
|
|
14
11
|
thread_pool_max_workers: Optional[int] = Field(
|
15
12
|
default=None,
|
@@ -24,9 +21,7 @@ class TasksRunnerSettings(PrefectBaseSettings):
|
|
24
21
|
|
25
22
|
|
26
23
|
class TasksSchedulingSettings(PrefectBaseSettings):
|
27
|
-
model_config =
|
28
|
-
env_prefix="PREFECT_TASKS_SCHEDULING_", env_file=".env", extra="ignore"
|
29
|
-
)
|
24
|
+
model_config = _build_settings_config(("tasks", "scheduling"))
|
30
25
|
|
31
26
|
default_storage_block: Optional[str] = Field(
|
32
27
|
default=None,
|
@@ -50,9 +45,7 @@ class TasksSchedulingSettings(PrefectBaseSettings):
|
|
50
45
|
|
51
46
|
|
52
47
|
class TasksSettings(PrefectBaseSettings):
|
53
|
-
model_config =
|
54
|
-
env_prefix="PREFECT_TASKS_", env_file=".env", extra="ignore"
|
55
|
-
)
|
48
|
+
model_config = _build_settings_config(("tasks",))
|
56
49
|
|
57
50
|
refresh_cache: bool = Field(
|
58
51
|
default=False,
|
@@ -80,6 +73,12 @@ class TasksSettings(PrefectBaseSettings):
|
|
80
73
|
),
|
81
74
|
)
|
82
75
|
|
76
|
+
default_persist_result: Optional[bool] = Field(
|
77
|
+
default=None,
|
78
|
+
description="If `True`, results will be persisted by default for all tasks. Set to `False` to disable persistence by default. "
|
79
|
+
"Note that setting to `False` will override the behavior set by a parent flow or task.",
|
80
|
+
)
|
81
|
+
|
83
82
|
runner: TasksRunnerSettings = Field(
|
84
83
|
default_factory=TasksRunnerSettings,
|
85
84
|
description="Settings for controlling task runner behavior",
|