prefect-client 3.1.10__py3-none-any.whl → 3.1.12__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/_experimental/lineage.py +7 -8
- prefect/_experimental/sla/__init__.py +0 -0
- prefect/_experimental/sla/client.py +66 -0
- prefect/_experimental/sla/objects.py +53 -0
- prefect/_internal/_logging.py +15 -3
- prefect/_internal/compatibility/async_dispatch.py +22 -16
- prefect/_internal/compatibility/deprecated.py +42 -18
- prefect/_internal/compatibility/migration.py +2 -2
- prefect/_internal/concurrency/inspection.py +12 -14
- prefect/_internal/concurrency/primitives.py +2 -2
- prefect/_internal/concurrency/services.py +154 -80
- prefect/_internal/concurrency/waiters.py +13 -9
- prefect/_internal/pydantic/annotations/pendulum.py +7 -7
- prefect/_internal/pytz.py +4 -3
- prefect/_internal/retries.py +10 -5
- prefect/_internal/schemas/bases.py +19 -10
- prefect/_internal/schemas/validators.py +227 -388
- prefect/_version.py +3 -3
- prefect/automations.py +236 -30
- prefect/blocks/__init__.py +3 -3
- prefect/blocks/abstract.py +53 -30
- prefect/blocks/core.py +183 -84
- prefect/blocks/notifications.py +133 -73
- prefect/blocks/redis.py +13 -9
- prefect/blocks/system.py +24 -11
- prefect/blocks/webhook.py +7 -5
- prefect/cache_policies.py +3 -2
- prefect/client/orchestration/__init__.py +1957 -0
- prefect/client/orchestration/_artifacts/__init__.py +0 -0
- prefect/client/orchestration/_artifacts/client.py +239 -0
- prefect/client/orchestration/_automations/__init__.py +0 -0
- prefect/client/orchestration/_automations/client.py +329 -0
- prefect/client/orchestration/_blocks_documents/__init__.py +0 -0
- prefect/client/orchestration/_blocks_documents/client.py +334 -0
- prefect/client/orchestration/_blocks_schemas/__init__.py +0 -0
- prefect/client/orchestration/_blocks_schemas/client.py +200 -0
- prefect/client/orchestration/_blocks_types/__init__.py +0 -0
- prefect/client/orchestration/_blocks_types/client.py +380 -0
- prefect/client/orchestration/_concurrency_limits/__init__.py +0 -0
- prefect/client/orchestration/_concurrency_limits/client.py +762 -0
- prefect/client/orchestration/_deployments/__init__.py +0 -0
- prefect/client/orchestration/_deployments/client.py +1128 -0
- prefect/client/orchestration/_flow_runs/__init__.py +0 -0
- prefect/client/orchestration/_flow_runs/client.py +903 -0
- prefect/client/orchestration/_flows/__init__.py +0 -0
- prefect/client/orchestration/_flows/client.py +343 -0
- prefect/client/orchestration/_logs/__init__.py +0 -0
- prefect/client/orchestration/_logs/client.py +97 -0
- prefect/client/orchestration/_variables/__init__.py +0 -0
- prefect/client/orchestration/_variables/client.py +157 -0
- prefect/client/orchestration/base.py +46 -0
- prefect/client/orchestration/routes.py +145 -0
- prefect/client/schemas/__init__.py +68 -28
- prefect/client/schemas/actions.py +2 -2
- prefect/client/schemas/filters.py +5 -0
- prefect/client/schemas/objects.py +8 -15
- prefect/client/schemas/schedules.py +22 -10
- prefect/concurrency/_asyncio.py +87 -0
- prefect/concurrency/{events.py → _events.py} +10 -10
- prefect/concurrency/asyncio.py +20 -104
- prefect/concurrency/context.py +6 -4
- prefect/concurrency/services.py +26 -74
- prefect/concurrency/sync.py +23 -44
- prefect/concurrency/v1/_asyncio.py +63 -0
- prefect/concurrency/v1/{events.py → _events.py} +13 -15
- prefect/concurrency/v1/asyncio.py +27 -80
- prefect/concurrency/v1/context.py +6 -4
- prefect/concurrency/v1/services.py +33 -79
- prefect/concurrency/v1/sync.py +18 -37
- prefect/context.py +66 -45
- prefect/deployments/base.py +10 -144
- prefect/deployments/flow_runs.py +12 -2
- prefect/deployments/runner.py +53 -4
- prefect/deployments/steps/pull.py +13 -0
- prefect/engine.py +17 -4
- prefect/events/clients.py +7 -1
- prefect/events/schemas/events.py +3 -2
- prefect/filesystems.py +6 -2
- prefect/flow_engine.py +101 -85
- prefect/flows.py +10 -1
- prefect/input/run_input.py +2 -1
- prefect/logging/logging.yml +1 -1
- prefect/main.py +1 -3
- prefect/results.py +2 -307
- prefect/runner/runner.py +4 -2
- prefect/runner/storage.py +87 -21
- prefect/serializers.py +32 -25
- prefect/settings/legacy.py +4 -4
- prefect/settings/models/api.py +3 -3
- prefect/settings/models/cli.py +3 -3
- prefect/settings/models/client.py +5 -3
- prefect/settings/models/cloud.py +8 -3
- prefect/settings/models/deployments.py +3 -3
- prefect/settings/models/experiments.py +4 -7
- prefect/settings/models/flows.py +3 -3
- prefect/settings/models/internal.py +4 -2
- prefect/settings/models/logging.py +4 -3
- prefect/settings/models/results.py +3 -3
- prefect/settings/models/root.py +3 -2
- prefect/settings/models/runner.py +4 -4
- prefect/settings/models/server/api.py +3 -3
- prefect/settings/models/server/database.py +11 -4
- prefect/settings/models/server/deployments.py +6 -2
- prefect/settings/models/server/ephemeral.py +4 -2
- prefect/settings/models/server/events.py +3 -2
- prefect/settings/models/server/flow_run_graph.py +6 -2
- prefect/settings/models/server/root.py +3 -3
- prefect/settings/models/server/services.py +26 -11
- prefect/settings/models/server/tasks.py +6 -3
- prefect/settings/models/server/ui.py +3 -3
- prefect/settings/models/tasks.py +5 -5
- prefect/settings/models/testing.py +3 -3
- prefect/settings/models/worker.py +5 -3
- prefect/settings/profiles.py +15 -2
- prefect/states.py +61 -45
- prefect/task_engine.py +54 -75
- prefect/task_runners.py +56 -55
- prefect/task_worker.py +2 -2
- prefect/tasks.py +90 -36
- prefect/telemetry/bootstrap.py +10 -9
- prefect/telemetry/run_telemetry.py +13 -8
- prefect/telemetry/services.py +4 -0
- prefect/transactions.py +4 -15
- prefect/utilities/_git.py +34 -0
- prefect/utilities/asyncutils.py +1 -1
- prefect/utilities/engine.py +3 -19
- prefect/utilities/generics.py +18 -0
- prefect/utilities/templating.py +25 -1
- prefect/workers/base.py +6 -3
- prefect/workers/process.py +1 -1
- {prefect_client-3.1.10.dist-info → prefect_client-3.1.12.dist-info}/METADATA +2 -2
- {prefect_client-3.1.10.dist-info → prefect_client-3.1.12.dist-info}/RECORD +135 -109
- prefect/client/orchestration.py +0 -4523
- prefect/records/__init__.py +0 -1
- prefect/records/base.py +0 -235
- prefect/records/filesystem.py +0 -213
- prefect/records/memory.py +0 -184
- prefect/records/result_store.py +0 -70
- {prefect_client-3.1.10.dist-info → prefect_client-3.1.12.dist-info}/LICENSE +0 -0
- {prefect_client-3.1.10.dist-info → prefect_client-3.1.12.dist-info}/WHEEL +0 -0
- {prefect_client-3.1.10.dist-info → prefect_client-3.1.12.dist-info}/top_level.txt +0 -0
prefect/serializers.py
CHANGED
@@ -11,9 +11,8 @@ All serializers must implement `dumps` and `loads` which convert objects to byte
|
|
11
11
|
bytes to an object respectively.
|
12
12
|
"""
|
13
13
|
|
14
|
-
import abc
|
15
14
|
import base64
|
16
|
-
from typing import Any, Generic, Optional,
|
15
|
+
from typing import Any, ClassVar, Generic, Optional, Union, overload
|
17
16
|
|
18
17
|
from pydantic import (
|
19
18
|
BaseModel,
|
@@ -54,7 +53,7 @@ def prefect_json_object_encoder(obj: Any) -> Any:
|
|
54
53
|
}
|
55
54
|
|
56
55
|
|
57
|
-
def prefect_json_object_decoder(result: dict[str, Any]):
|
56
|
+
def prefect_json_object_decoder(result: dict[str, Any]) -> Any:
|
58
57
|
"""
|
59
58
|
`JSONDecoder.object_hook` for decoding objects from JSON when previously encoded
|
60
59
|
with `prefect_json_object_encoder`
|
@@ -70,7 +69,7 @@ def prefect_json_object_decoder(result: dict[str, Any]):
|
|
70
69
|
|
71
70
|
|
72
71
|
@register_base_type
|
73
|
-
class Serializer(BaseModel, Generic[D]
|
72
|
+
class Serializer(BaseModel, Generic[D]):
|
74
73
|
"""
|
75
74
|
A serializer that can encode objects of type 'D' into bytes.
|
76
75
|
"""
|
@@ -80,10 +79,18 @@ class Serializer(BaseModel, Generic[D], abc.ABC):
|
|
80
79
|
data.setdefault("type", type_string)
|
81
80
|
super().__init__(**data)
|
82
81
|
|
83
|
-
|
84
|
-
|
82
|
+
@overload
|
83
|
+
def __new__(cls, *, type: str, **kwargs: Any) -> "Serializer[Any]":
|
84
|
+
...
|
85
|
+
|
86
|
+
@overload
|
87
|
+
def __new__(cls, *, type: None = ..., **kwargs: Any) -> Self:
|
88
|
+
...
|
89
|
+
|
90
|
+
def __new__(cls, **kwargs: Any) -> Union[Self, "Serializer[Any]"]:
|
91
|
+
if type_ := kwargs.get("type"):
|
85
92
|
try:
|
86
|
-
subcls = lookup_type(cls, dispatch_key=
|
93
|
+
subcls = lookup_type(cls, dispatch_key=type_)
|
87
94
|
except KeyError as exc:
|
88
95
|
raise ValidationError.from_exception_data(
|
89
96
|
title=cls.__name__,
|
@@ -97,15 +104,15 @@ class Serializer(BaseModel, Generic[D], abc.ABC):
|
|
97
104
|
|
98
105
|
type: str
|
99
106
|
|
100
|
-
@abc.abstractmethod
|
101
107
|
def dumps(self, obj: D) -> bytes:
|
102
108
|
"""Encode the object into a blob of bytes."""
|
109
|
+
raise NotImplementedError
|
103
110
|
|
104
|
-
@abc.abstractmethod
|
105
111
|
def loads(self, blob: bytes) -> D:
|
106
112
|
"""Decode the blob of bytes into an object."""
|
113
|
+
raise NotImplementedError
|
107
114
|
|
108
|
-
model_config = ConfigDict(extra="forbid")
|
115
|
+
model_config: ClassVar[ConfigDict] = ConfigDict(extra="forbid")
|
109
116
|
|
110
117
|
@classmethod
|
111
118
|
def __dispatch_key__(cls) -> Optional[str]:
|
@@ -113,7 +120,7 @@ class Serializer(BaseModel, Generic[D], abc.ABC):
|
|
113
120
|
return type_str if isinstance(type_str, str) else None
|
114
121
|
|
115
122
|
|
116
|
-
class PickleSerializer(Serializer):
|
123
|
+
class PickleSerializer(Serializer[D]):
|
117
124
|
"""
|
118
125
|
Serializes objects using the pickle protocol.
|
119
126
|
|
@@ -132,17 +139,17 @@ class PickleSerializer(Serializer):
|
|
132
139
|
def check_picklelib(cls, value: str) -> str:
|
133
140
|
return validate_picklelib(value)
|
134
141
|
|
135
|
-
def dumps(self, obj:
|
142
|
+
def dumps(self, obj: D) -> bytes:
|
136
143
|
pickler = from_qualified_name(self.picklelib)
|
137
144
|
blob = pickler.dumps(obj)
|
138
145
|
return base64.encodebytes(blob)
|
139
146
|
|
140
|
-
def loads(self, blob: bytes) ->
|
147
|
+
def loads(self, blob: bytes) -> D:
|
141
148
|
pickler = from_qualified_name(self.picklelib)
|
142
149
|
return pickler.loads(base64.decodebytes(blob))
|
143
150
|
|
144
151
|
|
145
|
-
class JSONSerializer(Serializer):
|
152
|
+
class JSONSerializer(Serializer[D]):
|
146
153
|
"""
|
147
154
|
Serializes data to JSON.
|
148
155
|
|
@@ -186,7 +193,7 @@ class JSONSerializer(Serializer):
|
|
186
193
|
) -> dict[str, Any]:
|
187
194
|
return validate_load_kwargs(value)
|
188
195
|
|
189
|
-
def dumps(self, obj:
|
196
|
+
def dumps(self, obj: D) -> bytes:
|
190
197
|
json = from_qualified_name(self.jsonlib)
|
191
198
|
kwargs = self.dumps_kwargs.copy()
|
192
199
|
if self.object_encoder:
|
@@ -197,7 +204,7 @@ class JSONSerializer(Serializer):
|
|
197
204
|
result = result.encode()
|
198
205
|
return result
|
199
206
|
|
200
|
-
def loads(self, blob: bytes) ->
|
207
|
+
def loads(self, blob: bytes) -> D:
|
201
208
|
json = from_qualified_name(self.jsonlib)
|
202
209
|
kwargs = self.loads_kwargs.copy()
|
203
210
|
if self.object_decoder:
|
@@ -205,7 +212,7 @@ class JSONSerializer(Serializer):
|
|
205
212
|
return json.loads(blob.decode(), **kwargs)
|
206
213
|
|
207
214
|
|
208
|
-
class CompressedSerializer(Serializer):
|
215
|
+
class CompressedSerializer(Serializer[D]):
|
209
216
|
"""
|
210
217
|
Wraps another serializer, compressing its output.
|
211
218
|
Uses `lzma` by default. See `compressionlib` for using alternative libraries.
|
@@ -219,43 +226,43 @@ class CompressedSerializer(Serializer):
|
|
219
226
|
|
220
227
|
type: str = Field(default="compressed", frozen=True)
|
221
228
|
|
222
|
-
serializer: Serializer
|
229
|
+
serializer: Serializer[D]
|
223
230
|
compressionlib: str = "lzma"
|
224
231
|
|
225
232
|
@field_validator("serializer", mode="before")
|
226
|
-
def validate_serializer(cls, value: Union[str, Serializer]) -> Serializer:
|
233
|
+
def validate_serializer(cls, value: Union[str, Serializer[D]]) -> Serializer[D]:
|
227
234
|
return cast_type_names_to_serializers(value)
|
228
235
|
|
229
236
|
@field_validator("compressionlib")
|
230
237
|
def check_compressionlib(cls, value: str) -> str:
|
231
238
|
return validate_compressionlib(value)
|
232
239
|
|
233
|
-
def dumps(self, obj:
|
240
|
+
def dumps(self, obj: D) -> bytes:
|
234
241
|
blob = self.serializer.dumps(obj)
|
235
242
|
compressor = from_qualified_name(self.compressionlib)
|
236
243
|
return base64.encodebytes(compressor.compress(blob))
|
237
244
|
|
238
|
-
def loads(self, blob: bytes) ->
|
245
|
+
def loads(self, blob: bytes) -> D:
|
239
246
|
compressor = from_qualified_name(self.compressionlib)
|
240
247
|
uncompressed = compressor.decompress(base64.decodebytes(blob))
|
241
248
|
return self.serializer.loads(uncompressed)
|
242
249
|
|
243
250
|
|
244
|
-
class CompressedPickleSerializer(CompressedSerializer):
|
251
|
+
class CompressedPickleSerializer(CompressedSerializer[D]):
|
245
252
|
"""
|
246
253
|
A compressed serializer preconfigured to use the pickle serializer.
|
247
254
|
"""
|
248
255
|
|
249
256
|
type: str = Field(default="compressed/pickle", frozen=True)
|
250
257
|
|
251
|
-
serializer: Serializer = Field(default_factory=PickleSerializer)
|
258
|
+
serializer: Serializer[D] = Field(default_factory=PickleSerializer)
|
252
259
|
|
253
260
|
|
254
|
-
class CompressedJSONSerializer(CompressedSerializer):
|
261
|
+
class CompressedJSONSerializer(CompressedSerializer[D]):
|
255
262
|
"""
|
256
263
|
A compressed serializer preconfigured to use the json serializer.
|
257
264
|
"""
|
258
265
|
|
259
266
|
type: str = Field(default="compressed/json", frozen=True)
|
260
267
|
|
261
|
-
serializer: Serializer = Field(default_factory=JSONSerializer)
|
268
|
+
serializer: Serializer[D] = Field(default_factory=JSONSerializer)
|
prefect/settings/legacy.py
CHANGED
@@ -23,9 +23,9 @@ class Setting:
|
|
23
23
|
self._default = default
|
24
24
|
self._type = type_
|
25
25
|
if accessor is None:
|
26
|
-
self.accessor = _env_var_to_accessor(name)
|
26
|
+
self.accessor: str = _env_var_to_accessor(name)
|
27
27
|
else:
|
28
|
-
self.accessor = accessor
|
28
|
+
self.accessor: str = accessor
|
29
29
|
|
30
30
|
@property
|
31
31
|
def name(self):
|
@@ -58,7 +58,7 @@ class Setting:
|
|
58
58
|
|
59
59
|
return self.value_from(get_current_settings())
|
60
60
|
|
61
|
-
def value_from(self: Self, settings:
|
61
|
+
def value_from(self: Self, settings: Settings) -> Any:
|
62
62
|
path = self.accessor.split(".")
|
63
63
|
current_value = settings
|
64
64
|
for key in path:
|
@@ -97,7 +97,7 @@ def _get_valid_setting_names(cls: type[BaseSettings]) -> Set[str]:
|
|
97
97
|
"""
|
98
98
|
A set of valid setting names, e.g. "PREFECT_API_URL" or "PREFECT_API_KEY".
|
99
99
|
"""
|
100
|
-
settings_fields = set()
|
100
|
+
settings_fields: set[str] = set()
|
101
101
|
for field_name, field in cls.model_fields.items():
|
102
102
|
if inspect.isclass(field.annotation) and issubclass(
|
103
103
|
field.annotation, PrefectBaseSettings
|
prefect/settings/models/api.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import os
|
2
|
-
from typing import Optional
|
2
|
+
from typing import ClassVar, Optional
|
3
3
|
|
4
|
-
from pydantic import Field, SecretStr
|
4
|
+
from pydantic import ConfigDict, Field, SecretStr
|
5
5
|
|
6
6
|
from prefect.settings.base import (
|
7
7
|
PrefectBaseSettings,
|
@@ -14,7 +14,7 @@ class APISettings(PrefectBaseSettings):
|
|
14
14
|
Settings for interacting with the Prefect API
|
15
15
|
"""
|
16
16
|
|
17
|
-
model_config = _build_settings_config(("api",))
|
17
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("api",))
|
18
18
|
url: Optional[str] = Field(
|
19
19
|
default=None,
|
20
20
|
description="The URL of the Prefect API. If not set, the client will attempt to infer it.",
|
prefect/settings/models/cli.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
from typing import Optional
|
1
|
+
from typing import ClassVar, Optional
|
2
2
|
|
3
|
-
from pydantic import Field
|
3
|
+
from pydantic import ConfigDict, Field
|
4
4
|
|
5
5
|
from prefect.settings.base import (
|
6
6
|
PrefectBaseSettings,
|
@@ -13,7 +13,7 @@ class CLISettings(PrefectBaseSettings):
|
|
13
13
|
Settings for controlling CLI behavior
|
14
14
|
"""
|
15
15
|
|
16
|
-
model_config = _build_settings_config(("cli",))
|
16
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("cli",))
|
17
17
|
|
18
18
|
colors: bool = Field(
|
19
19
|
default=True,
|
@@ -1,4 +1,6 @@
|
|
1
|
-
from
|
1
|
+
from typing import ClassVar
|
2
|
+
|
3
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
2
4
|
|
3
5
|
from prefect.settings.base import (
|
4
6
|
PrefectBaseSettings,
|
@@ -12,7 +14,7 @@ class ClientMetricsSettings(PrefectBaseSettings):
|
|
12
14
|
Settings for controlling metrics reporting from the client
|
13
15
|
"""
|
14
16
|
|
15
|
-
model_config = _build_settings_config(("client", "metrics"))
|
17
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("client", "metrics"))
|
16
18
|
|
17
19
|
enabled: bool = Field(
|
18
20
|
default=False,
|
@@ -37,7 +39,7 @@ class ClientSettings(PrefectBaseSettings):
|
|
37
39
|
Settings for controlling API client behavior
|
38
40
|
"""
|
39
41
|
|
40
|
-
model_config = _build_settings_config(("client",))
|
42
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("client",))
|
41
43
|
|
42
44
|
max_retries: int = Field(
|
43
45
|
default=5,
|
prefect/settings/models/cloud.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import re
|
2
|
-
from typing import Optional
|
2
|
+
from typing import ClassVar, Optional
|
3
3
|
|
4
|
-
from pydantic import Field, model_validator
|
4
|
+
from pydantic import ConfigDict, Field, model_validator
|
5
5
|
from typing_extensions import Self
|
6
6
|
|
7
7
|
from prefect.settings.base import (
|
@@ -32,13 +32,18 @@ class CloudSettings(PrefectBaseSettings):
|
|
32
32
|
Settings for interacting with Prefect Cloud
|
33
33
|
"""
|
34
34
|
|
35
|
-
model_config = _build_settings_config(("cloud",))
|
35
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("cloud",))
|
36
36
|
|
37
37
|
api_url: str = Field(
|
38
38
|
default="https://api.prefect.cloud/api",
|
39
39
|
description="API URL for Prefect Cloud. Used for authentication with Prefect Cloud.",
|
40
40
|
)
|
41
41
|
|
42
|
+
enable_orchestration_telemetry: bool = Field(
|
43
|
+
default=True,
|
44
|
+
description="Whether or not to enable orchestration telemetry.",
|
45
|
+
)
|
46
|
+
|
42
47
|
ui_url: Optional[str] = Field(
|
43
48
|
default=None,
|
44
49
|
description="The URL of the Prefect Cloud UI. If not set, the client will attempt to infer it.",
|
@@ -1,6 +1,6 @@
|
|
1
|
-
from typing import Optional
|
1
|
+
from typing import ClassVar, Optional
|
2
2
|
|
3
|
-
from pydantic import AliasChoices, AliasPath, Field
|
3
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
4
4
|
|
5
5
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
6
6
|
|
@@ -10,7 +10,7 @@ class DeploymentsSettings(PrefectBaseSettings):
|
|
10
10
|
Settings for configuring deployments defaults
|
11
11
|
"""
|
12
12
|
|
13
|
-
model_config = _build_settings_config(("deployments",))
|
13
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("deployments",))
|
14
14
|
|
15
15
|
default_work_pool_name: Optional[str] = Field(
|
16
16
|
default=None,
|
@@ -1,4 +1,6 @@
|
|
1
|
-
from
|
1
|
+
from typing import ClassVar
|
2
|
+
|
3
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
2
4
|
|
3
5
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
4
6
|
|
@@ -8,7 +10,7 @@ class ExperimentsSettings(PrefectBaseSettings):
|
|
8
10
|
Settings for configuring experimental features
|
9
11
|
"""
|
10
12
|
|
11
|
-
model_config = _build_settings_config(("experiments",))
|
13
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("experiments",))
|
12
14
|
|
13
15
|
warn: bool = Field(
|
14
16
|
default=True,
|
@@ -18,11 +20,6 @@ class ExperimentsSettings(PrefectBaseSettings):
|
|
18
20
|
),
|
19
21
|
)
|
20
22
|
|
21
|
-
telemetry_enabled: bool = Field(
|
22
|
-
default=False,
|
23
|
-
description="Enables sending telemetry to Prefect Cloud.",
|
24
|
-
)
|
25
|
-
|
26
23
|
lineage_events_enabled: bool = Field(
|
27
24
|
default=False,
|
28
25
|
description="If `True`, enables emitting lineage events. Set to `False` to disable lineage event emission.",
|
prefect/settings/models/flows.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
from typing import Union
|
1
|
+
from typing import ClassVar, Union
|
2
2
|
|
3
|
-
from pydantic import AliasChoices, AliasPath, Field
|
3
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
4
4
|
|
5
5
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
6
6
|
|
@@ -10,7 +10,7 @@ class FlowsSettings(PrefectBaseSettings):
|
|
10
10
|
Settings for controlling flow behavior
|
11
11
|
"""
|
12
12
|
|
13
|
-
model_config = _build_settings_config(("flows",))
|
13
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("flows",))
|
14
14
|
|
15
15
|
default_retries: int = Field(
|
16
16
|
default=0,
|
@@ -1,11 +1,13 @@
|
|
1
|
-
from
|
1
|
+
from typing import ClassVar
|
2
|
+
|
3
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
2
4
|
|
3
5
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
4
6
|
from prefect.types import LogLevel
|
5
7
|
|
6
8
|
|
7
9
|
class InternalSettings(PrefectBaseSettings):
|
8
|
-
model_config = _build_settings_config(("internal",))
|
10
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("internal",))
|
9
11
|
|
10
12
|
logging_level: LogLevel = Field(
|
11
13
|
default="ERROR",
|
@@ -1,11 +1,12 @@
|
|
1
1
|
from functools import partial
|
2
2
|
from pathlib import Path
|
3
|
-
from typing import Annotated, Literal, Optional, Union
|
3
|
+
from typing import Annotated, ClassVar, Literal, Optional, Union
|
4
4
|
|
5
5
|
from pydantic import (
|
6
6
|
AliasChoices,
|
7
7
|
AliasPath,
|
8
8
|
BeforeValidator,
|
9
|
+
ConfigDict,
|
9
10
|
Field,
|
10
11
|
model_validator,
|
11
12
|
)
|
@@ -32,7 +33,7 @@ class LoggingToAPISettings(PrefectBaseSettings):
|
|
32
33
|
Settings for controlling logging to the API
|
33
34
|
"""
|
34
35
|
|
35
|
-
model_config = _build_settings_config(("logging", "to_api"))
|
36
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("logging", "to_api"))
|
36
37
|
|
37
38
|
enabled: bool = Field(
|
38
39
|
default=True,
|
@@ -85,7 +86,7 @@ class LoggingSettings(PrefectBaseSettings):
|
|
85
86
|
Settings for controlling logging behavior
|
86
87
|
"""
|
87
88
|
|
88
|
-
model_config = _build_settings_config(("logging",))
|
89
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("logging",))
|
89
90
|
|
90
91
|
level: LogLevel = Field(
|
91
92
|
default="INFO",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from pathlib import Path
|
2
|
-
from typing import Optional
|
2
|
+
from typing import ClassVar, Optional
|
3
3
|
|
4
|
-
from pydantic import AliasChoices, AliasPath, Field
|
4
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
5
5
|
|
6
6
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
7
7
|
|
@@ -11,7 +11,7 @@ class ResultsSettings(PrefectBaseSettings):
|
|
11
11
|
Settings for controlling result storage behavior
|
12
12
|
"""
|
13
13
|
|
14
|
-
model_config = _build_settings_config(("results",))
|
14
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("results",))
|
15
15
|
|
16
16
|
default_serializer: str = Field(
|
17
17
|
default="pickle",
|
prefect/settings/models/root.py
CHANGED
@@ -4,13 +4,14 @@ from typing import (
|
|
4
4
|
TYPE_CHECKING,
|
5
5
|
Annotated,
|
6
6
|
Any,
|
7
|
+
ClassVar,
|
7
8
|
Iterable,
|
8
9
|
Mapping,
|
9
10
|
Optional,
|
10
11
|
)
|
11
12
|
from urllib.parse import urlparse
|
12
13
|
|
13
|
-
from pydantic import BeforeValidator, Field, SecretStr, model_validator
|
14
|
+
from pydantic import BeforeValidator, ConfigDict, Field, SecretStr, model_validator
|
14
15
|
from typing_extensions import Self
|
15
16
|
|
16
17
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
@@ -43,7 +44,7 @@ class Settings(PrefectBaseSettings):
|
|
43
44
|
See https://docs.pydantic.dev/latest/concepts/pydantic_settings
|
44
45
|
"""
|
45
46
|
|
46
|
-
model_config = _build_settings_config()
|
47
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config()
|
47
48
|
|
48
49
|
home: Annotated[Path, BeforeValidator(lambda x: Path(x).expanduser())] = Field(
|
49
50
|
default=Path("~") / ".prefect",
|
@@ -1,6 +1,6 @@
|
|
1
|
-
from typing import Optional
|
1
|
+
from typing import ClassVar, Optional
|
2
2
|
|
3
|
-
from pydantic import Field
|
3
|
+
from pydantic import ConfigDict, Field
|
4
4
|
|
5
5
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
6
6
|
from prefect.types import LogLevel
|
@@ -11,7 +11,7 @@ class RunnerServerSettings(PrefectBaseSettings):
|
|
11
11
|
Settings for controlling runner server behavior
|
12
12
|
"""
|
13
13
|
|
14
|
-
model_config = _build_settings_config(("runner", "server"))
|
14
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("runner", "server"))
|
15
15
|
|
16
16
|
enable: bool = Field(
|
17
17
|
default=False,
|
@@ -44,7 +44,7 @@ class RunnerSettings(PrefectBaseSettings):
|
|
44
44
|
Settings for controlling runner behavior
|
45
45
|
"""
|
46
46
|
|
47
|
-
model_config = _build_settings_config(("runner",))
|
47
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("runner",))
|
48
48
|
|
49
49
|
process_limit: int = Field(
|
50
50
|
default=5,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from datetime import timedelta
|
2
|
-
from typing import Optional
|
2
|
+
from typing import ClassVar, Optional
|
3
3
|
|
4
|
-
from pydantic import AliasChoices, AliasPath, Field, SecretStr
|
4
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field, SecretStr
|
5
5
|
|
6
6
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
7
7
|
|
@@ -11,7 +11,7 @@ class ServerAPISettings(PrefectBaseSettings):
|
|
11
11
|
Settings for controlling API server behavior
|
12
12
|
"""
|
13
13
|
|
14
|
-
model_config = _build_settings_config(("server", "api"))
|
14
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("server", "api"))
|
15
15
|
|
16
16
|
auth_string: Optional[SecretStr] = Field(
|
17
17
|
default=None,
|
@@ -1,8 +1,15 @@
|
|
1
1
|
import warnings
|
2
|
-
from typing import Optional
|
2
|
+
from typing import ClassVar, Optional
|
3
3
|
from urllib.parse import quote_plus
|
4
4
|
|
5
|
-
from pydantic import
|
5
|
+
from pydantic import (
|
6
|
+
AliasChoices,
|
7
|
+
AliasPath,
|
8
|
+
ConfigDict,
|
9
|
+
Field,
|
10
|
+
SecretStr,
|
11
|
+
model_validator,
|
12
|
+
)
|
6
13
|
from typing_extensions import Literal, Self
|
7
14
|
|
8
15
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
@@ -13,7 +20,7 @@ class ServerDatabaseSettings(PrefectBaseSettings):
|
|
13
20
|
Settings for controlling server database behavior
|
14
21
|
"""
|
15
22
|
|
16
|
-
model_config = _build_settings_config(("server", "database"))
|
23
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("server", "database"))
|
17
24
|
|
18
25
|
connection_url: Optional[SecretStr] = Field(
|
19
26
|
default=None,
|
@@ -130,7 +137,7 @@ class ServerDatabaseSettings(PrefectBaseSettings):
|
|
130
137
|
)
|
131
138
|
|
132
139
|
connection_timeout: Optional[float] = Field(
|
133
|
-
default=5,
|
140
|
+
default=5.0,
|
134
141
|
description="A connection timeout, in seconds, applied to database connections. Defaults to `5`.",
|
135
142
|
validation_alias=AliasChoices(
|
136
143
|
AliasPath("connection_timeout"),
|
@@ -1,10 +1,14 @@
|
|
1
|
-
from
|
1
|
+
from typing import ClassVar
|
2
|
+
|
3
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
2
4
|
|
3
5
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
4
6
|
|
5
7
|
|
6
8
|
class ServerDeploymentsSettings(PrefectBaseSettings):
|
7
|
-
model_config = _build_settings_config(
|
9
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(
|
10
|
+
("server", "deployments")
|
11
|
+
)
|
8
12
|
|
9
13
|
concurrency_slot_wait_seconds: float = Field(
|
10
14
|
default=30.0,
|
@@ -1,4 +1,6 @@
|
|
1
|
-
from
|
1
|
+
from typing import ClassVar
|
2
|
+
|
3
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
2
4
|
|
3
5
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
4
6
|
|
@@ -8,7 +10,7 @@ class ServerEphemeralSettings(PrefectBaseSettings):
|
|
8
10
|
Settings for controlling ephemeral server behavior
|
9
11
|
"""
|
10
12
|
|
11
|
-
model_config = _build_settings_config(("server", "ephemeral"))
|
13
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("server", "ephemeral"))
|
12
14
|
|
13
15
|
enabled: bool = Field(
|
14
16
|
default=False,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from datetime import timedelta
|
2
|
+
from typing import ClassVar
|
2
3
|
|
3
|
-
from pydantic import AliasChoices, AliasPath, Field
|
4
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
4
5
|
|
5
6
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
6
7
|
|
@@ -10,7 +11,7 @@ class ServerEventsSettings(PrefectBaseSettings):
|
|
10
11
|
Settings for controlling behavior of the events subsystem
|
11
12
|
"""
|
12
13
|
|
13
|
-
model_config = _build_settings_config(("server", "events"))
|
14
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("server", "events"))
|
14
15
|
|
15
16
|
###########################################################################
|
16
17
|
# Events settings
|
@@ -1,4 +1,6 @@
|
|
1
|
-
from
|
1
|
+
from typing import ClassVar
|
2
|
+
|
3
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
2
4
|
|
3
5
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
4
6
|
|
@@ -8,7 +10,9 @@ class ServerFlowRunGraphSettings(PrefectBaseSettings):
|
|
8
10
|
Settings for controlling behavior of the flow run graph
|
9
11
|
"""
|
10
12
|
|
11
|
-
model_config = _build_settings_config(
|
13
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(
|
14
|
+
("server", "flow_run_graph")
|
15
|
+
)
|
12
16
|
|
13
17
|
max_nodes: int = Field(
|
14
18
|
default=10000,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from pathlib import Path
|
2
|
-
from typing import Optional
|
2
|
+
from typing import ClassVar, Optional
|
3
3
|
|
4
|
-
from pydantic import AliasChoices, AliasPath, Field
|
4
|
+
from pydantic import AliasChoices, AliasPath, ConfigDict, Field
|
5
5
|
|
6
6
|
from prefect.settings.base import PrefectBaseSettings, _build_settings_config
|
7
7
|
from prefect.types import LogLevel
|
@@ -22,7 +22,7 @@ class ServerSettings(PrefectBaseSettings):
|
|
22
22
|
Settings for controlling server behavior
|
23
23
|
"""
|
24
24
|
|
25
|
-
model_config = _build_settings_config(("server",))
|
25
|
+
model_config: ClassVar[ConfigDict] = _build_settings_config(("server",))
|
26
26
|
|
27
27
|
logging_level: LogLevel = Field(
|
28
28
|
default="WARNING",
|