prefect-client 2.16.6__py3-none-any.whl → 2.16.7__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/_internal/pydantic/__init__.py +21 -1
- prefect/_internal/pydantic/_base_model.py +16 -0
- prefect/_internal/pydantic/_compat.py +325 -74
- prefect/_internal/pydantic/_flags.py +15 -0
- prefect/_internal/schemas/validators.py +582 -9
- prefect/artifacts.py +179 -70
- prefect/client/orchestration.py +1 -1
- prefect/client/schemas/actions.py +2 -2
- prefect/client/schemas/objects.py +13 -24
- prefect/client/schemas/schedules.py +18 -80
- prefect/deployments/deployments.py +22 -86
- prefect/deployments/runner.py +8 -11
- prefect/events/__init__.py +40 -1
- prefect/events/clients.py +17 -20
- prefect/events/filters.py +5 -6
- prefect/events/related.py +1 -1
- prefect/events/schemas/__init__.py +5 -0
- prefect/events/schemas/automations.py +303 -0
- prefect/events/{schemas.py → schemas/deployment_triggers.py} +146 -270
- prefect/events/schemas/events.py +285 -0
- prefect/events/schemas/labelling.py +106 -0
- prefect/events/utilities.py +2 -2
- prefect/events/worker.py +1 -1
- prefect/filesystems.py +8 -37
- prefect/flows.py +4 -4
- prefect/infrastructure/kubernetes.py +12 -56
- prefect/infrastructure/provisioners/__init__.py +1 -0
- prefect/pydantic/__init__.py +4 -0
- prefect/pydantic/main.py +15 -0
- prefect/runner/runner.py +2 -2
- prefect/runner/server.py +1 -1
- prefect/serializers.py +13 -61
- prefect/settings.py +34 -12
- prefect/task_server.py +21 -7
- prefect/utilities/asyncutils.py +1 -1
- prefect/utilities/context.py +33 -1
- prefect/workers/base.py +1 -2
- prefect/workers/block.py +3 -7
- {prefect_client-2.16.6.dist-info → prefect_client-2.16.7.dist-info}/METADATA +2 -2
- {prefect_client-2.16.6.dist-info → prefect_client-2.16.7.dist-info}/RECORD +43 -36
- prefect/utilities/validation.py +0 -63
- {prefect_client-2.16.6.dist-info → prefect_client-2.16.7.dist-info}/LICENSE +0 -0
- {prefect_client-2.16.6.dist-info → prefect_client-2.16.7.dist-info}/WHEEL +0 -0
- {prefect_client-2.16.6.dist-info → prefect_client-2.16.7.dist-info}/top_level.txt +0 -0
prefect/runner/server.py
CHANGED
@@ -8,6 +8,7 @@ from prefect._vendor.fastapi.responses import JSONResponse
|
|
8
8
|
from typing_extensions import Literal
|
9
9
|
|
10
10
|
from prefect._internal.pydantic import HAS_PYDANTIC_V2
|
11
|
+
from prefect._internal.schemas.validators import validate_values_conform_to_schema
|
11
12
|
from prefect.client.orchestration import get_client
|
12
13
|
from prefect.exceptions import MissingFlowError, ScriptError
|
13
14
|
from prefect.flows import Flow, load_flow_from_entrypoint, load_flows_from_script
|
@@ -24,7 +25,6 @@ from prefect.settings import (
|
|
24
25
|
PREFECT_RUNNER_SERVER_PORT,
|
25
26
|
)
|
26
27
|
from prefect.utilities.asyncutils import sync_compatible
|
27
|
-
from prefect.utilities.validation import validate_values_conform_to_schema
|
28
28
|
|
29
29
|
if TYPE_CHECKING:
|
30
30
|
from prefect.client.schemas.responses import DeploymentResponse
|
prefect/serializers.py
CHANGED
@@ -16,6 +16,13 @@ import warnings
|
|
16
16
|
from typing import Any, Generic, Optional, TypeVar
|
17
17
|
|
18
18
|
from prefect._internal.pydantic import HAS_PYDANTIC_V2
|
19
|
+
from prefect._internal.schemas.validators import (
|
20
|
+
cast_type_names_to_serializers,
|
21
|
+
validate_compressionlib,
|
22
|
+
validate_dump_kwargs,
|
23
|
+
validate_load_kwargs,
|
24
|
+
validate_picklelib,
|
25
|
+
)
|
19
26
|
|
20
27
|
if HAS_PYDANTIC_V2:
|
21
28
|
import pydantic.v1 as pydantic
|
@@ -101,27 +108,7 @@ class PickleSerializer(Serializer):
|
|
101
108
|
|
102
109
|
@pydantic.validator("picklelib")
|
103
110
|
def check_picklelib(cls, value):
|
104
|
-
|
105
|
-
Check that the given pickle library is importable and has dumps/loads methods.
|
106
|
-
"""
|
107
|
-
try:
|
108
|
-
pickler = from_qualified_name(value)
|
109
|
-
except (ImportError, AttributeError) as exc:
|
110
|
-
raise ValueError(
|
111
|
-
f"Failed to import requested pickle library: {value!r}."
|
112
|
-
) from exc
|
113
|
-
|
114
|
-
if not callable(getattr(pickler, "dumps", None)):
|
115
|
-
raise ValueError(
|
116
|
-
f"Pickle library at {value!r} does not have a 'dumps' method."
|
117
|
-
)
|
118
|
-
|
119
|
-
if not callable(getattr(pickler, "loads", None)):
|
120
|
-
raise ValueError(
|
121
|
-
f"Pickle library at {value!r} does not have a 'loads' method."
|
122
|
-
)
|
123
|
-
|
124
|
-
return value
|
111
|
+
return validate_picklelib(value)
|
125
112
|
|
126
113
|
@pydantic.root_validator
|
127
114
|
def check_picklelib_version(cls, values):
|
@@ -196,23 +183,11 @@ class JSONSerializer(Serializer):
|
|
196
183
|
|
197
184
|
@pydantic.validator("dumps_kwargs")
|
198
185
|
def dumps_kwargs_cannot_contain_default(cls, value):
|
199
|
-
|
200
|
-
# class unserializable anyway.
|
201
|
-
if "default" in value:
|
202
|
-
raise ValueError(
|
203
|
-
"`default` cannot be provided. Use `object_encoder` instead."
|
204
|
-
)
|
205
|
-
return value
|
186
|
+
return validate_dump_kwargs(value)
|
206
187
|
|
207
188
|
@pydantic.validator("loads_kwargs")
|
208
189
|
def loads_kwargs_cannot_contain_object_hook(cls, value):
|
209
|
-
|
210
|
-
# this class unserializable anyway.
|
211
|
-
if "object_hook" in value:
|
212
|
-
raise ValueError(
|
213
|
-
"`object_hook` cannot be provided. Use `object_decoder` instead."
|
214
|
-
)
|
215
|
-
return value
|
190
|
+
return validate_load_kwargs(value)
|
216
191
|
|
217
192
|
def dumps(self, data: Any) -> bytes:
|
218
193
|
json = from_qualified_name(self.jsonlib)
|
@@ -251,35 +226,12 @@ class CompressedSerializer(Serializer):
|
|
251
226
|
compressionlib: str = "lzma"
|
252
227
|
|
253
228
|
@pydantic.validator("serializer", pre=True)
|
254
|
-
def
|
255
|
-
|
256
|
-
return Serializer(type=value)
|
257
|
-
return value
|
229
|
+
def validate_serializer(cls, value):
|
230
|
+
return cast_type_names_to_serializers(value)
|
258
231
|
|
259
232
|
@pydantic.validator("compressionlib")
|
260
233
|
def check_compressionlib(cls, value):
|
261
|
-
|
262
|
-
Check that the given pickle library is importable and has compress/decompress
|
263
|
-
methods.
|
264
|
-
"""
|
265
|
-
try:
|
266
|
-
compressor = from_qualified_name(value)
|
267
|
-
except (ImportError, AttributeError) as exc:
|
268
|
-
raise ValueError(
|
269
|
-
f"Failed to import requested compression library: {value!r}."
|
270
|
-
) from exc
|
271
|
-
|
272
|
-
if not callable(getattr(compressor, "compress", None)):
|
273
|
-
raise ValueError(
|
274
|
-
f"Compression library at {value!r} does not have a 'compress' method."
|
275
|
-
)
|
276
|
-
|
277
|
-
if not callable(getattr(compressor, "decompress", None)):
|
278
|
-
raise ValueError(
|
279
|
-
f"Compression library at {value!r} does not have a 'decompress' method."
|
280
|
-
)
|
281
|
-
|
282
|
-
return value
|
234
|
+
return validate_compressionlib(value)
|
283
235
|
|
284
236
|
def dumps(self, obj: Any) -> bytes:
|
285
237
|
blob = self.serializer.dumps(obj)
|
prefect/settings.py
CHANGED
@@ -51,6 +51,7 @@ from typing import (
|
|
51
51
|
Any,
|
52
52
|
Callable,
|
53
53
|
Dict,
|
54
|
+
Generator,
|
54
55
|
Generic,
|
55
56
|
Iterable,
|
56
57
|
List,
|
@@ -600,8 +601,8 @@ PREFECT_API_SSL_CERT_FILE = Setting(
|
|
600
601
|
default=os.environ.get("SSL_CERT_FILE"),
|
601
602
|
)
|
602
603
|
"""
|
603
|
-
This configuration settings option specifies the path to an SSL certificate file.
|
604
|
-
When set, it allows the application to use the specified certificate for secure communication.
|
604
|
+
This configuration settings option specifies the path to an SSL certificate file.
|
605
|
+
When set, it allows the application to use the specified certificate for secure communication.
|
605
606
|
If left unset, the setting will default to the value provided by the `SSL_CERT_FILE` environment variable.
|
606
607
|
"""
|
607
608
|
|
@@ -1177,7 +1178,7 @@ this often. Defaults to `5`.
|
|
1177
1178
|
|
1178
1179
|
PREFECT_API_SERVICES_LATE_RUNS_AFTER_SECONDS = Setting(
|
1179
1180
|
timedelta,
|
1180
|
-
default=timedelta(seconds=
|
1181
|
+
default=timedelta(seconds=15),
|
1181
1182
|
)
|
1182
1183
|
"""The late runs service will mark runs as late after they
|
1183
1184
|
have exceeded their scheduled start time by this many seconds. Defaults
|
@@ -1422,6 +1423,16 @@ PREFECT_EXPERIMENTAL_WARN_FLOW_RUN_INPUT = Setting(bool, default=True)
|
|
1422
1423
|
Whether or not to enable flow run input.
|
1423
1424
|
"""
|
1424
1425
|
|
1426
|
+
|
1427
|
+
# Prefect Events feature flags
|
1428
|
+
|
1429
|
+
PREFECT_EXPERIMENTAL_EVENTS = Setting(bool, default=False)
|
1430
|
+
"""
|
1431
|
+
Whether to enable Prefect's server-side event features. Note that Prefect Cloud clients
|
1432
|
+
will always emit events during flow and task runs regardless of this setting.
|
1433
|
+
"""
|
1434
|
+
|
1435
|
+
|
1425
1436
|
PREFECT_RUNNER_PROCESS_LIMIT = Setting(int, default=5)
|
1426
1437
|
"""
|
1427
1438
|
Maximum number of processes a runner will execute in parallel.
|
@@ -1575,10 +1586,6 @@ PREFECT_EXPERIMENTAL_ENABLE_WORK_QUEUE_STATUS = Setting(bool, default=True)
|
|
1575
1586
|
Whether or not to enable experimental work queue status in-place of work queue health.
|
1576
1587
|
"""
|
1577
1588
|
|
1578
|
-
PREFECT_EXPERIMENTAL_ENABLE_PYDANTIC_V2_INTERNALS = Setting(bool, default=False)
|
1579
|
-
"""
|
1580
|
-
Whether or not to enable internal experimental Pydantic v2 behavior.
|
1581
|
-
"""
|
1582
1589
|
|
1583
1590
|
# Defaults -----------------------------------------------------------------------------
|
1584
1591
|
|
@@ -1623,6 +1630,19 @@ when attempting to serve the UI from the default directory (for example when run
|
|
1623
1630
|
"""
|
1624
1631
|
|
1625
1632
|
|
1633
|
+
# Events settings ------------------------------------------------------------------
|
1634
|
+
|
1635
|
+
PREFECT_EVENTS_MAXIMUM_LABELS_PER_RESOURCE = Setting(int, default=500)
|
1636
|
+
"""
|
1637
|
+
The maximum number of labels a resource may have.
|
1638
|
+
"""
|
1639
|
+
|
1640
|
+
PREFECT_EVENTS_MAXIMUM_RELATED_RESOURCES = Setting(int, default=500)
|
1641
|
+
"""
|
1642
|
+
The maximum number of related resources an Event may have.
|
1643
|
+
"""
|
1644
|
+
|
1645
|
+
|
1626
1646
|
# Deprecated settings ------------------------------------------------------------------
|
1627
1647
|
|
1628
1648
|
|
@@ -1877,10 +1897,10 @@ def get_default_settings() -> Settings:
|
|
1877
1897
|
|
1878
1898
|
@contextmanager
|
1879
1899
|
def temporary_settings(
|
1880
|
-
updates: Mapping[Setting, Any] = None,
|
1881
|
-
set_defaults: Mapping[Setting, Any] = None,
|
1882
|
-
restore_defaults: Iterable[Setting] = None,
|
1883
|
-
) -> Settings:
|
1900
|
+
updates: Optional[Mapping[Setting[T], Any]] = None,
|
1901
|
+
set_defaults: Optional[Mapping[Setting[T], Any]] = None,
|
1902
|
+
restore_defaults: Optional[Iterable[Setting[T]]] = None,
|
1903
|
+
) -> Generator[Settings, None, None]:
|
1884
1904
|
"""
|
1885
1905
|
Temporarily override the current settings by entering a new profile.
|
1886
1906
|
|
@@ -2132,7 +2152,9 @@ class ProfilesCollection:
|
|
2132
2152
|
)
|
2133
2153
|
|
2134
2154
|
|
2135
|
-
def _handle_removed_flags(
|
2155
|
+
def _handle_removed_flags(
|
2156
|
+
profile_name: str, settings: Dict[str, Any]
|
2157
|
+
) -> Dict[str, Any]:
|
2136
2158
|
to_remove = [name for name in settings if name in REMOVED_EXPERIMENTAL_FLAGS]
|
2137
2159
|
|
2138
2160
|
for name in to_remove:
|
prefect/task_server.py
CHANGED
@@ -16,6 +16,7 @@ from prefect._internal.concurrency.api import create_call, from_sync
|
|
16
16
|
from prefect.client.schemas.objects import TaskRun
|
17
17
|
from prefect.client.subscriptions import Subscription
|
18
18
|
from prefect.engine import emit_task_run_state_change_event, propose_state
|
19
|
+
from prefect.exceptions import Abort, PrefectHTTPStatusError
|
19
20
|
from prefect.logging.loggers import get_logger
|
20
21
|
from prefect.results import ResultFactory
|
21
22
|
from prefect.settings import (
|
@@ -192,18 +193,31 @@ class TaskServer:
|
|
192
193
|
f"Submitting run {task_run.name!r} of task {task.name!r} to engine"
|
193
194
|
)
|
194
195
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
196
|
+
try:
|
197
|
+
state = await propose_state(
|
198
|
+
client=get_client(), # TODO prove that we cannot use self._client here
|
199
|
+
state=Pending(),
|
200
|
+
task_run_id=task_run.id,
|
201
|
+
)
|
202
|
+
except Abort as exc:
|
203
|
+
logger.exception(
|
204
|
+
f"Failed to submit task run {task_run.id!r} to engine", exc_info=exc
|
205
|
+
)
|
206
|
+
return
|
207
|
+
except PrefectHTTPStatusError as exc:
|
208
|
+
if exc.response.status_code == 404:
|
209
|
+
logger.warning(
|
210
|
+
f"Task run {task_run.id!r} not found. It may have been deleted."
|
211
|
+
)
|
212
|
+
return
|
213
|
+
raise
|
200
214
|
|
201
215
|
if not state.is_pending():
|
202
216
|
logger.warning(
|
203
|
-
f"
|
217
|
+
f"Cancelling submission of task run {task_run.id!r} -"
|
204
218
|
f" server returned a non-pending state {state.type.value!r}."
|
205
|
-
" Task run may have already begun execution."
|
206
219
|
)
|
220
|
+
return
|
207
221
|
|
208
222
|
emit_task_run_state_change_event(
|
209
223
|
task_run=task_run,
|
prefect/utilities/asyncutils.py
CHANGED
@@ -343,7 +343,7 @@ async def add_event_loop_shutdown_callback(coroutine_fn: Callable[[], Awaitable]
|
|
343
343
|
# There is a poorly understood edge case we've seen in CI where the key is
|
344
344
|
# removed from the dict before we begin generator iteration.
|
345
345
|
except KeyError:
|
346
|
-
logger.
|
346
|
+
logger.warning("The event loop shutdown callback was not properly registered. ")
|
347
347
|
pass
|
348
348
|
|
349
349
|
|
prefect/utilities/context.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
from contextlib import contextmanager
|
2
2
|
from contextvars import Context, ContextVar, Token
|
3
|
-
from typing import Dict
|
3
|
+
from typing import TYPE_CHECKING, Dict, Optional, Tuple, cast
|
4
|
+
from uuid import UUID
|
5
|
+
|
6
|
+
if TYPE_CHECKING:
|
7
|
+
from prefect.client.schemas.objects import FlowRun, TaskRun
|
4
8
|
|
5
9
|
|
6
10
|
@contextmanager
|
@@ -14,3 +18,31 @@ def temporary_context(context: Context):
|
|
14
18
|
finally:
|
15
19
|
for key, token in tokens.items():
|
16
20
|
key.reset(token)
|
21
|
+
|
22
|
+
|
23
|
+
def get_task_run_id() -> Optional[UUID]:
|
24
|
+
from prefect.context import TaskRunContext
|
25
|
+
|
26
|
+
context = TaskRunContext.get()
|
27
|
+
if task_run := cast(Optional["TaskRun"], getattr(context, "task_run", None)):
|
28
|
+
return task_run.id
|
29
|
+
return None
|
30
|
+
|
31
|
+
|
32
|
+
def get_flow_run_id() -> Optional[UUID]:
|
33
|
+
from prefect.context import FlowRunContext
|
34
|
+
|
35
|
+
context = FlowRunContext.get()
|
36
|
+
if flow_run := cast(Optional["FlowRun"], getattr(context, "flow_run", None)):
|
37
|
+
return flow_run.id
|
38
|
+
return None
|
39
|
+
|
40
|
+
|
41
|
+
def get_task_and_flow_run_ids() -> Tuple[Optional[UUID], Optional[UUID]]:
|
42
|
+
"""
|
43
|
+
Get the task run and flow run ids from the context, if available.
|
44
|
+
|
45
|
+
Returns:
|
46
|
+
Tuple[Optional[UUID], Optional[UUID]]: a tuple of the task run id and flow run id
|
47
|
+
"""
|
48
|
+
return get_task_run_id(), get_flow_run_id()
|
prefect/workers/base.py
CHANGED
@@ -37,9 +37,8 @@ from prefect.client.schemas.filters import (
|
|
37
37
|
from prefect.client.schemas.objects import StateType, WorkPool
|
38
38
|
from prefect.client.utilities import inject_client
|
39
39
|
from prefect.engine import propose_state
|
40
|
-
from prefect.events import Event, emit_event
|
40
|
+
from prefect.events import Event, RelatedResource, emit_event
|
41
41
|
from prefect.events.related import object_as_related_resource, tags_as_related_resources
|
42
|
-
from prefect.events.schemas import RelatedResource
|
43
42
|
from prefect.exceptions import (
|
44
43
|
Abort,
|
45
44
|
InfrastructureNotAvailable,
|
prefect/workers/block.py
CHANGED
@@ -18,17 +18,13 @@ else:
|
|
18
18
|
|
19
19
|
from prefect.client.orchestration import PrefectClient
|
20
20
|
from prefect.client.utilities import inject_client
|
21
|
+
from prefect.events import RelatedResource
|
21
22
|
from prefect.events.related import object_as_related_resource, tags_as_related_resources
|
22
|
-
from prefect.
|
23
|
-
from prefect.utilities.templating import (
|
24
|
-
apply_values,
|
25
|
-
)
|
23
|
+
from prefect.utilities.templating import apply_values
|
26
24
|
|
27
25
|
if TYPE_CHECKING:
|
28
26
|
from prefect.client.schemas.objects import Flow, FlowRun
|
29
|
-
from prefect.client.schemas.responses import
|
30
|
-
DeploymentResponse,
|
31
|
-
)
|
27
|
+
from prefect.client.schemas.responses import DeploymentResponse
|
32
28
|
|
33
29
|
|
34
30
|
class BlockWorkerJobConfiguration(BaseModel):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: prefect-client
|
3
|
-
Version: 2.16.
|
3
|
+
Version: 2.16.7
|
4
4
|
Summary: Workflow orchestration and management.
|
5
5
|
Home-page: https://www.prefect.io
|
6
6
|
Author: Prefect Technologies, Inc.
|
@@ -51,7 +51,7 @@ Requires-Dist: sniffio <2.0.0,>=1.3.0
|
|
51
51
|
Requires-Dist: toml >=0.10.0
|
52
52
|
Requires-Dist: typing-extensions <5.0.0,>=4.5.0
|
53
53
|
Requires-Dist: ujson <6.0.0,>=5.8.0
|
54
|
-
Requires-Dist: uvicorn
|
54
|
+
Requires-Dist: uvicorn <0.29.0,>=0.14.0
|
55
55
|
Requires-Dist: websockets <13.0,>=10.4
|
56
56
|
Requires-Dist: itsdangerous
|
57
57
|
Requires-Dist: python-multipart >=0.0.7
|
@@ -2,25 +2,25 @@ prefect/.prefectignore,sha256=awSprvKT0vI8a64mEOLrMxhxqcO-b0ERQeYpA2rNKVQ,390
|
|
2
2
|
prefect/__init__.py,sha256=FqZ2FacBZq5wr-RnLQphwqXN0atLdu9bDC2YtmZi-AU,5456
|
3
3
|
prefect/_version.py,sha256=fQguBh1dzT7Baahj504O5RrsLlSyg3Zrx42OpgdPnFc,22378
|
4
4
|
prefect/agent.py,sha256=ZHRiQo13SC8F_flWaoWskVopM1DZKgZVwx9kkg_z0A0,27791
|
5
|
-
prefect/artifacts.py,sha256=
|
5
|
+
prefect/artifacts.py,sha256=mreaBE4qMoXkjc9YI-5cAxoye7ixraHB_zr8GTK9xPU,8694
|
6
6
|
prefect/context.py,sha256=QK_U3ym-h2i1Y_EOSr4BQeeMN0AIOpG81LQS7k1RiRA,18103
|
7
7
|
prefect/engine.py,sha256=kWU4jJQm3ApiJiuq3rZysyZZC2zBQc3DdJuYfpydmIE,110127
|
8
8
|
prefect/exceptions.py,sha256=84rpsDLp0cn_v2gE1TnK_NZXh27NJtzgZQtARVKyVEE,10953
|
9
|
-
prefect/filesystems.py,sha256=
|
9
|
+
prefect/filesystems.py,sha256=ndaoGezKKXSCGCwwr7h9I_Z_UeamWAxxbG5vnslCYao,35239
|
10
10
|
prefect/flow_runs.py,sha256=mFHLavZk1yZ62H3UazuNDBZWAF7AqKttA4rMcHgsVSw,3119
|
11
|
-
prefect/flows.py,sha256=
|
11
|
+
prefect/flows.py,sha256=7ZFIDdRMKn49UCFRmESBX6xJaiI7dJNUPmOsHGbxs2c,70287
|
12
12
|
prefect/futures.py,sha256=RaWfYIXtH7RsWxQ5QWTTlAzwtVV8XWpXaZT_hLq35vQ,12590
|
13
13
|
prefect/manifests.py,sha256=xfwEEozSEqPK2Lro4dfgdTnjVbQx-aCECNBnf7vO7ZQ,808
|
14
14
|
prefect/plugins.py,sha256=0C-D3-dKi06JZ44XEGmLjCiAkefbE_lKX-g3urzdbQ4,4163
|
15
15
|
prefect/profiles.toml,sha256=1Tz7nKBDTDXL_6KPJSeB7ok0Vx_aQJ_p0AUmbnzDLzw,39
|
16
16
|
prefect/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
17
|
prefect/results.py,sha256=FgudRagwoNKVKR5590I4AN0mxgYoyXG_7Q1HVoMXdaU,24731
|
18
|
-
prefect/serializers.py,sha256
|
19
|
-
prefect/settings.py,sha256=
|
18
|
+
prefect/serializers.py,sha256=-zMi0OivhnUMZsOqNPyP4EoV0tVf7HsanFeAxJiDmzw,9015
|
19
|
+
prefect/settings.py,sha256=04Y4AQP4rqeTKNPKXo3n2o-LmePGK3d8KMLlsZMQySo,71632
|
20
20
|
prefect/states.py,sha256=-Ud4AUom3Qu-HQ4hOLvfVZuuF-b_ibaqtzmL7V949Ac,20839
|
21
21
|
prefect/task_engine.py,sha256=_2I7XLwoT_nNhpzTMa_52aQKjsDoaW6WpzwIHYEWZS0,2598
|
22
22
|
prefect/task_runners.py,sha256=HXUg5UqhZRN2QNBqMdGE1lKhwFhT8TaRN75ScgLbnw8,11012
|
23
|
-
prefect/task_server.py,sha256=
|
23
|
+
prefect/task_server.py,sha256=HSbX9ftyLUkXKIWDzyPyza0ZnHBaE7Frvm4sp_uGDfE,11047
|
24
24
|
prefect/tasks.py,sha256=AFDCyb0p0r8mamiFMu220-DfGMLSjq-uRi4vL6oxQOE,50477
|
25
25
|
prefect/variables.py,sha256=sk3pfwfPY5lKLt4Qi7OQJPeYipzYip3gidgA9gydcpI,978
|
26
26
|
prefect/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -39,8 +39,10 @@ prefect/_internal/concurrency/primitives.py,sha256=kxCPD9yLtCeqt-JIHjevL4Zt5FvrF
|
|
39
39
|
prefect/_internal/concurrency/services.py,sha256=aggJd4IUSB6ufppRYdRT-36daEg1JSpJCvK635R8meg,11951
|
40
40
|
prefect/_internal/concurrency/threads.py,sha256=-tReWZL9_XMkRS35SydAfeePH2vqCqb1CGM8lgrKT1I,7846
|
41
41
|
prefect/_internal/concurrency/waiters.py,sha256=DXTD_bbVEUhcTplYQFX8mGmL6nsqJGEDfvS0TmHmIQk,9475
|
42
|
-
prefect/_internal/pydantic/__init__.py,sha256=
|
43
|
-
prefect/_internal/pydantic/
|
42
|
+
prefect/_internal/pydantic/__init__.py,sha256=r2FZa0rX3w9tv-9ajBXXn85o93T5nAOiiwPiLpvbmmw,786
|
43
|
+
prefect/_internal/pydantic/_base_model.py,sha256=eiLbeK7EfWAU0MZUrEG7iKmmwlWeySR7sZ8e_pSwwGc,317
|
44
|
+
prefect/_internal/pydantic/_compat.py,sha256=PAhyk479cZmh_hUcFmSWJuvgd_bKa22cszKb7Fut52U,14921
|
45
|
+
prefect/_internal/pydantic/_flags.py,sha256=sF-YJD85Al4npLbl43WDRyQzCZO8qWY4gE5_ZVixEZg,622
|
44
46
|
prefect/_internal/pydantic/schemas.py,sha256=tsRKq5yEIgiRbWMl3BPnbfNaKyDN6pq8WSs0M8SQMm4,452
|
45
47
|
prefect/_internal/pydantic/v1_schema.py,sha256=j_DDQqpP1xFsvkNSjWeviTnnFyNPPqou9n4M2lf3K2U,1133
|
46
48
|
prefect/_internal/pydantic/v2_schema.py,sha256=RE7VQaf6nefhdYU2O-gbzumMcuBk-fiH_6Rq9F7eAqg,3689
|
@@ -52,7 +54,7 @@ prefect/_internal/schemas/bases.py,sha256=hl6iBar9QfVQo7I7nJR6wnyL_KTrHeRqcWfQ7Q
|
|
52
54
|
prefect/_internal/schemas/fields.py,sha256=GMZeLPvrSRleomgKi73AyNKg8aqbh7ezWqGkreLVnMs,1385
|
53
55
|
prefect/_internal/schemas/serializers.py,sha256=G_RGHfObjisUiRvd29p-zc6W4bwt5rE1OdR6TXNrRhQ,825
|
54
56
|
prefect/_internal/schemas/transformations.py,sha256=PRMMso1TlRYSdRC7JvvddxHfkECbjxx5ienyLk93wyM,3730
|
55
|
-
prefect/_internal/schemas/validators.py,sha256=
|
57
|
+
prefect/_internal/schemas/validators.py,sha256=tQXH7KrOBUUlggzNvqQiIOULpr2L0GRmRdt561gVsgI,18855
|
56
58
|
prefect/_vendor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
57
59
|
prefect/_vendor/fastapi/__init__.py,sha256=u-zfck662O4-Bsz91pZM53R53pVmdEQ1LUgf2hZenb0,1096
|
58
60
|
prefect/_vendor/fastapi/applications.py,sha256=72zqRql-QLOjk68Wmnx4F1aW9_UcDXZ-lf-COP3aL1c,40983
|
@@ -144,15 +146,15 @@ prefect/client/base.py,sha256=VsJWgaSEyIbHo2MfIkBuErahYwXnU68P3R-n83jx2LI,15211
|
|
144
146
|
prefect/client/cloud.py,sha256=Ozf-jklZntlzOIKKlAh2YW4eJKgTsd1ln3W9N3xO5w4,4052
|
145
147
|
prefect/client/collections.py,sha256=I9EgbTg4Fn57gn8vwP_WdDmgnATbx9gfkm2jjhCORjw,1037
|
146
148
|
prefect/client/constants.py,sha256=Z_GG8KF70vbbXxpJuqW5pLnwzujTVeHbcYYRikNmGH0,29
|
147
|
-
prefect/client/orchestration.py,sha256=
|
149
|
+
prefect/client/orchestration.py,sha256=Xd_2iqedUurWidjMKNqS3sn0TqCMQs282DbpihVRKzM,111211
|
148
150
|
prefect/client/subscriptions.py,sha256=3kqPH3F-CwyrR5wygCpJMjRjM_gcQjd54Qjih6FcLlA,3372
|
149
151
|
prefect/client/utilities.py,sha256=oGU8dJIq7ExEF4WFt-0aSPNX0JP7uH6NmfRlNhfJu00,2660
|
150
152
|
prefect/client/schemas/__init__.py,sha256=KlyqFV-hMulMkNstBn_0ijoHoIwJZaBj6B1r07UmgvE,607
|
151
|
-
prefect/client/schemas/actions.py,sha256=
|
153
|
+
prefect/client/schemas/actions.py,sha256=HLPj7rTBfkOYtGSDVqTBAf8E2amr-FL0RcLnx2MbJpk,25941
|
152
154
|
prefect/client/schemas/filters.py,sha256=r6gnxZREnmE8Glt2SF6vPxHr0SIeiFBjTrrN32cw-Mo,35514
|
153
|
-
prefect/client/schemas/objects.py,sha256=
|
155
|
+
prefect/client/schemas/objects.py,sha256=U6cv8krNeAc2pO0LAW5RaeUtNbZCcerDuT-sx-AkzDY,55224
|
154
156
|
prefect/client/schemas/responses.py,sha256=hErSClfLjt3Ys18YZyZS6dyjVf3eLkiAF6mjEgF4LGg,9344
|
155
|
-
prefect/client/schemas/schedules.py,sha256=
|
157
|
+
prefect/client/schemas/schedules.py,sha256=4WnDokrEWcCDT0FrQsE765wo4kI4oEV0ZvZOyFAJ_ek,12297
|
156
158
|
prefect/client/schemas/sorting.py,sha256=Y-ea8k_vTUKAPKIxqGebwLSXM7x1s5mJ_4-sDd1Ivi8,2276
|
157
159
|
prefect/concurrency/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
158
160
|
prefect/concurrency/asyncio.py,sha256=S7FXJmzva4DDS3sOMBfWhM1Kimwu7zdEAqSPsM6qkr0,3055
|
@@ -162,8 +164,8 @@ prefect/concurrency/services.py,sha256=LQQXBFNUQTlAnHbdrr6GYcEExpGSaQzb-ZiqKk4rQ
|
|
162
164
|
prefect/concurrency/sync.py,sha256=AChhkA6hykgnnPmIeOp87jauLL0p_lrSwMwUoeuYprI,2148
|
163
165
|
prefect/deployments/__init__.py,sha256=HcC8IEOMaTz98M8uGsxAGITW11PS744XNsQBFz62Qow,441
|
164
166
|
prefect/deployments/base.py,sha256=8K4V3FXz0Fm5sMSLZ-5jRo59LSgEmtElURXrugVJxv8,21450
|
165
|
-
prefect/deployments/deployments.py,sha256=
|
166
|
-
prefect/deployments/runner.py,sha256=
|
167
|
+
prefect/deployments/deployments.py,sha256=mSG48Q2m7-7SlmNMBkpbsY1_oa3fD201NRDF5VfLZaw,40062
|
168
|
+
prefect/deployments/runner.py,sha256=ENUn_6-v17jUNJ9v4Q-rTOX4qL6aV9FY-PFONBwDWwk,45077
|
167
169
|
prefect/deployments/schedules.py,sha256=23GDCAKOP-aAEKGappwTrM4HU67ndVH7NR4Dq0neU_U,1884
|
168
170
|
prefect/deployments/steps/__init__.py,sha256=3pZWONAZzenDszqNQT3bmTFilnvjB6xMolMz9tr5pLw,229
|
169
171
|
prefect/deployments/steps/core.py,sha256=Mg2F5GBJyO-jBAAP7PGtIu1sZgNsvmw5Jn5Qj-bUlgk,6617
|
@@ -177,21 +179,25 @@ prefect/deprecated/packaging/docker.py,sha256=5l7zIfDXN8fOcIQKjRre3BZyBE4P0lhdv6
|
|
177
179
|
prefect/deprecated/packaging/file.py,sha256=CdyI9Gk9Zknce2BZZX04GvPP2u-O3z3y2cwydm0Fl_k,2861
|
178
180
|
prefect/deprecated/packaging/orion.py,sha256=Kz7PCWJbto01CRSUBPjENfX5PvMCcKlcjTtUBcGSM_8,2517
|
179
181
|
prefect/deprecated/packaging/serializers.py,sha256=cHKyraPKoScYyHkiNukf1Pi_QFmm_SrGuLbTnOy_id8,7035
|
180
|
-
prefect/events/__init__.py,sha256=
|
182
|
+
prefect/events/__init__.py,sha256=MykLdP-RCUoTgly7ZTF0wLInU2mlGyMfdb1wboExoFQ,1133
|
181
183
|
prefect/events/actions.py,sha256=wYc52xin_CLrNZaou05FdGdLZ5VEhT2lKM_k-MQEJ34,1398
|
182
|
-
prefect/events/clients.py,sha256=
|
183
|
-
prefect/events/filters.py,sha256=
|
184
|
+
prefect/events/clients.py,sha256=Ywm5X-FqY7LOFX1bjPEfAv3FIJJUDzSX4d0oc-cBWNI,14019
|
185
|
+
prefect/events/filters.py,sha256=mZMenXHpLrcpIQLD7LgU-kPR_fCDRZImV50qa6iNP7E,6931
|
184
186
|
prefect/events/instrument.py,sha256=uNiD7AnkfuiwTsCMgNyJURmY9H2tXNfLCb3EC5FL0Qw,3805
|
185
|
-
prefect/events/related.py,sha256=
|
186
|
-
prefect/events/
|
187
|
-
prefect/events/
|
188
|
-
prefect/events/
|
187
|
+
prefect/events/related.py,sha256=OW0E4GaQ8qsqcX7hF0M-55qo4dAVrjpqkUeZyJbVWrQ,6753
|
188
|
+
prefect/events/utilities.py,sha256=-8H2mVLNxd8q3aEz6-6UCS6SmLSxxhNWaEh2kipBjVo,2458
|
189
|
+
prefect/events/worker.py,sha256=9Vg_Yz2ktglpBcBYpvzHRTvYAh397LoyUw0ctxTgB64,2723
|
190
|
+
prefect/events/schemas/__init__.py,sha256=YUyTEY9yVEJAOXWLng7-WlgNlTlJ25kDNPey3pXkn4k,169
|
191
|
+
prefect/events/schemas/automations.py,sha256=Shbr6P6DvWfy7mXkyHHzOnEWHyC6zMgwhaYg-t2WDlk,9648
|
192
|
+
prefect/events/schemas/deployment_triggers.py,sha256=1-eqR7eZNMddpGmyrzATYMQrt6mDUtJG_Bl8FvIUAU4,15782
|
193
|
+
prefect/events/schemas/events.py,sha256=YuFia29g7pfvrGaW6lxMFpjADzJ8dp1pllxalgfXXf0,9223
|
194
|
+
prefect/events/schemas/labelling.py,sha256=CzAry2clY6oa8fpSDE43mFtecFFaH3QYz-fqYiE7XdU,3229
|
189
195
|
prefect/infrastructure/__init__.py,sha256=Fm1Rhc4I7ZfJePpUAl1F4iNEtcDugoT650WXXt6xoCM,770
|
190
196
|
prefect/infrastructure/base.py,sha256=s2nNbwXnqHV-sBy7LeZzV1IVjqAO0zv795HM4RHOvQI,10880
|
191
197
|
prefect/infrastructure/container.py,sha256=RuWqxSgwwoAxJ9FquYH12wEUizMQM9_b-e5p13ZVscI,31851
|
192
|
-
prefect/infrastructure/kubernetes.py,sha256=
|
198
|
+
prefect/infrastructure/kubernetes.py,sha256=28DLYNomVj2edmtM1c0ksbGUkBd1GwOlIIMDdSaLPbw,35703
|
193
199
|
prefect/infrastructure/process.py,sha256=e03OmOOvXx08KNCQZas0D7SqHq4_b6QelLvIMkmxJlo,11943
|
194
|
-
prefect/infrastructure/provisioners/__init__.py,sha256=
|
200
|
+
prefect/infrastructure/provisioners/__init__.py,sha256=e9rfFnLqqwjexvYoiRZIY-CEwK-7ZhCQm745Z-Uxon8,1666
|
195
201
|
prefect/infrastructure/provisioners/cloud_run.py,sha256=kqk8yRZ4gfGJLgCEJL8vNYvRyONe2Mc4e_0DHeEb0iM,17658
|
196
202
|
prefect/infrastructure/provisioners/container_instance.py,sha256=KgJ6-vbq32VLCBiYgrCeG68wa6DfJvA2AmJHCeOY5q8,41231
|
197
203
|
prefect/infrastructure/provisioners/ecs.py,sha256=qFHRLMuU0HduCEcuU0ZiEhnKeGFnk1MOQ75sDUCUL2Q,47631
|
@@ -207,9 +213,11 @@ prefect/logging/handlers.py,sha256=zypWVA9EbaKMimRnZWxjmYYmZE04pB7OP5zKwkrOYHQ,1
|
|
207
213
|
prefect/logging/highlighters.py,sha256=BpSXOy0n3lFVvlKWa7jC-HetAiClFi9jnQtEq5-rgok,1681
|
208
214
|
prefect/logging/loggers.py,sha256=Ci8KgqKCG8R6fDAlnR8iiLTVTYuPIvaFIfcY-AFgCLM,9323
|
209
215
|
prefect/logging/logging.yml,sha256=UkEewf0c3_dURI2uCU4RrxkhI5Devoa1s93fl7hilcg,3160
|
216
|
+
prefect/pydantic/__init__.py,sha256=B9zp8cQVJHxMi3hrZuLO-2hNGYMeoDnKWBaKIl7Z3-I,92
|
217
|
+
prefect/pydantic/main.py,sha256=IFfh1cKE3TYrst8DSavF66CwYb4UmzW7AR1NIPbuMOM,397
|
210
218
|
prefect/runner/__init__.py,sha256=d3DFUXy5BYd8Z4cppNN_6RTSddmr-KfnQ5Yw5vh8WL8,96
|
211
|
-
prefect/runner/runner.py,sha256=
|
212
|
-
prefect/runner/server.py,sha256=
|
219
|
+
prefect/runner/runner.py,sha256=Kjx6KVnBgMoHWOwl2w4wLdCLxBxbbVql8KI714UUntM,48079
|
220
|
+
prefect/runner/server.py,sha256=mgjH5SPlj3xu0_pZHg15zw59OSJ5lIzTIZ101s281Oo,10655
|
213
221
|
prefect/runner/storage.py,sha256=iZey8Am51c1fZFpS9iVXWYpKiM_lSocvaJEOZVExhvA,22428
|
214
222
|
prefect/runner/submit.py,sha256=w53VdsqfwjW-M3e8hUAAoVlNrXsvGuuyGpEN0wi3vX0,8537
|
215
223
|
prefect/runner/utils.py,sha256=G8qv6AwAa43HcgLOo5vDhoXna1xP0HlaMVYEbAv0Pck,3318
|
@@ -226,11 +234,11 @@ prefect/software/pip.py,sha256=WMOo-uVu5Az5N-1lOG9hpW6uSscP__N1hn6Vi3ItJms,4039
|
|
226
234
|
prefect/software/python.py,sha256=reuEJFZPJ5PrDMfK3BuPpYieHNkOXJAyCAaopQcjDqE,1767
|
227
235
|
prefect/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
228
236
|
prefect/utilities/annotations.py,sha256=p33yhh1Zx8BZUlTtl8gKRbpwWU9FVnZ8cfYrcd5KxDI,3103
|
229
|
-
prefect/utilities/asyncutils.py,sha256=
|
237
|
+
prefect/utilities/asyncutils.py,sha256=G4vjJ9IeWHLVAZTh0ilclHkhsBnZtsO6lzyDX75RtSU,15677
|
230
238
|
prefect/utilities/callables.py,sha256=seO853HYt7gXl2-tHZMM_7rrXrvsAxk9qwzJ89UN8_E,11647
|
231
239
|
prefect/utilities/collections.py,sha256=D_DT489rTCwyzZb021i0xp8osBkkQgSW9XLOoLBzgkg,15436
|
232
240
|
prefect/utilities/compat.py,sha256=mNQZDnzyKaOqy-OV-DnmH_dc7CNF5nQgW_EsA4xMr7g,906
|
233
|
-
prefect/utilities/context.py,sha256=
|
241
|
+
prefect/utilities/context.py,sha256=BThuUW94-IYgFYTeMIM9KMo8ShT3oiI7w5ajZHzU1j0,1377
|
234
242
|
prefect/utilities/dispatch.py,sha256=dcezbuJRsD_YYfJrsk5pGiqzJsdUhb9RxJ_lq8nXeds,5466
|
235
243
|
prefect/utilities/dockerutils.py,sha256=O5lIgCej5KGRYU2TC1NzNuIK595uOIWJilhZXYEVtOA,20180
|
236
244
|
prefect/utilities/filesystem.py,sha256=M_TeZ1MftjBf7hDLWk-Iphir369TpJ1binMsBKiO9YE,4449
|
@@ -245,19 +253,18 @@ prefect/utilities/services.py,sha256=u0Gpdw5pYceaSLCqOihGyFb2AlMBYE2P9Ts9qRb3N9Q
|
|
245
253
|
prefect/utilities/slugify.py,sha256=57Vb14t13F3zm1P65KAu8nVeAz0iJCd1Qc5eMG-R5y8,169
|
246
254
|
prefect/utilities/templating.py,sha256=t32Gcsvvm8ibzdqXwcWzY7JkwftPn73FiiLYEnQWyKM,13237
|
247
255
|
prefect/utilities/text.py,sha256=eXGIsCcZ7h_6hy8T5GDQjL8GiKyktoOqavYub0QjgO4,445
|
248
|
-
prefect/utilities/validation.py,sha256=60AseIr0F1XlygAuqweswz288i7YP4LlLY00s1dM2cg,1985
|
249
256
|
prefect/utilities/visualization.py,sha256=iGkYtroroYY9Rsiw1ok1bLv9FwsNyjtiK-0vBPL-ZWI,6491
|
250
257
|
prefect/utilities/schema_tools/__init__.py,sha256=YtbTThhL8nPEYm3ByTHeOLcj2fm8fXrsxB-ioBWoIek,284
|
251
258
|
prefect/utilities/schema_tools/hydration.py,sha256=tonsuKKmjnPnqzFTx441y9g3nhziiWlDesYJqezEmCQ,6181
|
252
259
|
prefect/utilities/schema_tools/validation.py,sha256=b4ZsyrUlU7riaQP9NMQ6FlayzG46SrSE7pKGNCFWscM,7974
|
253
260
|
prefect/workers/__init__.py,sha256=6el2Q856CuRPa5Hdrbm9QyAWB_ovcT2bImSFsoWI46k,66
|
254
|
-
prefect/workers/base.py,sha256=
|
255
|
-
prefect/workers/block.py,sha256=
|
261
|
+
prefect/workers/base.py,sha256=uYI-D_M2boA-O7IV099BNqu-FKQGjYBdRA83KHwUO0w,44610
|
262
|
+
prefect/workers/block.py,sha256=aPdOFQ0ng4rVCyA5O_F9R0y-AM9yt9SBuuymc2f14zc,7733
|
256
263
|
prefect/workers/process.py,sha256=Kxj_eZYh6R8t8253LYIIafiG7dodCF8RZABwd3Ng_R0,10253
|
257
264
|
prefect/workers/server.py,sha256=WVZJxR8nTMzK0ov0BD0xw5OyQpT26AxlXbsGQ1OrxeQ,1551
|
258
265
|
prefect/workers/utilities.py,sha256=VfPfAlGtTuDj0-Kb8WlMgAuOfgXCdrGAnKMapPSBrwc,2483
|
259
|
-
prefect_client-2.16.
|
260
|
-
prefect_client-2.16.
|
261
|
-
prefect_client-2.16.
|
262
|
-
prefect_client-2.16.
|
263
|
-
prefect_client-2.16.
|
266
|
+
prefect_client-2.16.7.dist-info/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
|
267
|
+
prefect_client-2.16.7.dist-info/METADATA,sha256=FAisd1nA6cQC3EHbuqUKEETW538cMGywwI7IlNg0WdM,7357
|
268
|
+
prefect_client-2.16.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
269
|
+
prefect_client-2.16.7.dist-info/top_level.txt,sha256=MJZYJgFdbRc2woQCeB4vM6T33tr01TmkEhRcns6H_H4,8
|
270
|
+
prefect_client-2.16.7.dist-info/RECORD,,
|
prefect/utilities/validation.py
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
import jsonschema
|
2
|
-
|
3
|
-
from prefect.utilities.collections import remove_nested_keys
|
4
|
-
|
5
|
-
|
6
|
-
def validate_schema(schema: dict):
|
7
|
-
"""
|
8
|
-
Validate that the provided schema is a valid json schema.
|
9
|
-
|
10
|
-
Args:
|
11
|
-
schema: The schema to validate.
|
12
|
-
|
13
|
-
Raises:
|
14
|
-
ValueError: If the provided schema is not a valid json schema.
|
15
|
-
|
16
|
-
"""
|
17
|
-
try:
|
18
|
-
if schema is not None:
|
19
|
-
# Most closely matches the schemas generated by pydantic
|
20
|
-
jsonschema.Draft4Validator.check_schema(schema)
|
21
|
-
except jsonschema.SchemaError as exc:
|
22
|
-
raise ValueError(
|
23
|
-
"The provided schema is not a valid json schema. Schema error:"
|
24
|
-
f" {exc.message}"
|
25
|
-
) from exc
|
26
|
-
|
27
|
-
|
28
|
-
def validate_values_conform_to_schema(
|
29
|
-
values: dict, schema: dict, ignore_required: bool = False
|
30
|
-
):
|
31
|
-
"""
|
32
|
-
Validate that the provided values conform to the provided json schema.
|
33
|
-
|
34
|
-
Args:
|
35
|
-
values: The values to validate.
|
36
|
-
schema: The schema to validate against.
|
37
|
-
ignore_required: Whether to ignore the required fields in the schema. Should be
|
38
|
-
used when a partial set of values is acceptable.
|
39
|
-
|
40
|
-
Raises:
|
41
|
-
ValueError: If the parameters do not conform to the schema.
|
42
|
-
|
43
|
-
"""
|
44
|
-
if ignore_required:
|
45
|
-
schema = remove_nested_keys(["required"], schema)
|
46
|
-
|
47
|
-
try:
|
48
|
-
if schema is not None and values is not None:
|
49
|
-
jsonschema.validate(values, schema)
|
50
|
-
except jsonschema.ValidationError as exc:
|
51
|
-
if exc.json_path == "$":
|
52
|
-
error_message = "Validation failed."
|
53
|
-
else:
|
54
|
-
error_message = (
|
55
|
-
f"Validation failed for field {exc.json_path.replace('$.', '')!r}."
|
56
|
-
)
|
57
|
-
error_message += f" Failure reason: {exc.message}"
|
58
|
-
raise ValueError(error_message) from exc
|
59
|
-
except jsonschema.SchemaError as exc:
|
60
|
-
raise ValueError(
|
61
|
-
"The provided schema is not a valid json schema. Schema error:"
|
62
|
-
f" {exc.message}"
|
63
|
-
) from exc
|
File without changes
|
File without changes
|
File without changes
|