prefect-client 3.4.7.dev6__py3-none-any.whl → 3.4.7.dev7__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/_build_info.py +3 -3
- prefect/client/orchestration/_deployments/client.py +2 -2
- prefect/client/orchestration/_flows/client.py +4 -4
- prefect/client/schemas/filters.py +3 -0
- prefect/flows.py +64 -45
- prefect/tasks.py +1 -4
- prefect/utilities/engine.py +2 -4
- {prefect_client-3.4.7.dev6.dist-info → prefect_client-3.4.7.dev7.dist-info}/METADATA +1 -1
- {prefect_client-3.4.7.dev6.dist-info → prefect_client-3.4.7.dev7.dist-info}/RECORD +11 -11
- {prefect_client-3.4.7.dev6.dist-info → prefect_client-3.4.7.dev7.dist-info}/WHEEL +0 -0
- {prefect_client-3.4.7.dev6.dist-info → prefect_client-3.4.7.dev7.dist-info}/licenses/LICENSE +0 -0
prefect/_build_info.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Generated by versioningit
|
2
|
-
__version__ = "3.4.7.
|
3
|
-
__build_date__ = "2025-06-
|
4
|
-
__git_commit__ = "
|
2
|
+
__version__ = "3.4.7.dev7"
|
3
|
+
__build_date__ = "2025-06-24 08:09:27.221869+00:00"
|
4
|
+
__git_commit__ = "3614ff28a5600b1965c957a04e880aaf38442ad5"
|
5
5
|
__dirty__ = False
|
@@ -297,7 +297,7 @@ class DeploymentClient(BaseClient):
|
|
297
297
|
deployment_id: the deployment ID of interest
|
298
298
|
|
299
299
|
Returns:
|
300
|
-
a
|
300
|
+
a Deployment model representation of the deployment
|
301
301
|
"""
|
302
302
|
|
303
303
|
from prefect.client.schemas.responses import DeploymentResponse
|
@@ -961,7 +961,7 @@ class DeploymentAsyncClient(BaseAsyncClient):
|
|
961
961
|
deployment_id: the deployment ID of interest
|
962
962
|
|
963
963
|
Returns:
|
964
|
-
a
|
964
|
+
a Deployment model representation of the deployment
|
965
965
|
"""
|
966
966
|
|
967
967
|
from prefect.client.schemas.responses import DeploymentResponse
|
@@ -31,7 +31,7 @@ class FlowClient(BaseClient):
|
|
31
31
|
Create a flow in the Prefect API.
|
32
32
|
|
33
33
|
Args:
|
34
|
-
flow: a
|
34
|
+
flow: a `Flow` object
|
35
35
|
|
36
36
|
Raises:
|
37
37
|
httpx.RequestError: if a flow was not created for any reason
|
@@ -78,7 +78,7 @@ class FlowClient(BaseClient):
|
|
78
78
|
flow_id: the flow ID of interest
|
79
79
|
|
80
80
|
Returns:
|
81
|
-
a
|
81
|
+
a Flow model representation of the flow
|
82
82
|
"""
|
83
83
|
response = self.request("GET", "/flows/{id}", path_params={"id": flow_id})
|
84
84
|
from prefect.client.schemas.objects import Flow
|
@@ -190,7 +190,7 @@ class FlowAsyncClient(BaseAsyncClient):
|
|
190
190
|
Create a flow in the Prefect API.
|
191
191
|
|
192
192
|
Args:
|
193
|
-
flow: a
|
193
|
+
flow: a `Flow` object
|
194
194
|
|
195
195
|
Raises:
|
196
196
|
httpx.RequestError: if a flow was not created for any reason
|
@@ -237,7 +237,7 @@ class FlowAsyncClient(BaseAsyncClient):
|
|
237
237
|
flow_id: the flow ID of interest
|
238
238
|
|
239
239
|
Returns:
|
240
|
-
a
|
240
|
+
a Flow model representation of the flow
|
241
241
|
"""
|
242
242
|
response = await self.request("GET", "/flows/{id}", path_params={"id": flow_id})
|
243
243
|
from prefect.client.schemas.objects import Flow
|
@@ -462,6 +462,9 @@ class DeploymentFilterId(PrefectBaseModel):
|
|
462
462
|
any_: Optional[List[UUID]] = Field(
|
463
463
|
default=None, description="A list of deployment ids to include"
|
464
464
|
)
|
465
|
+
not_any_: Optional[List[UUID]] = Field(
|
466
|
+
default=None, description="A list of deployment ids to exclude"
|
467
|
+
)
|
465
468
|
|
466
469
|
|
467
470
|
class DeploymentFilterName(PrefectBaseModel):
|
prefect/flows.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
Module containing the base workflow class and decorator - for most use cases, using the
|
2
|
+
Module containing the base workflow class and decorator - for most use cases, using the `@flow` decorator is preferred.
|
3
3
|
"""
|
4
4
|
|
5
5
|
from __future__ import annotations
|
@@ -145,9 +145,6 @@ class Flow(Generic[P, R]):
|
|
145
145
|
"""
|
146
146
|
A Prefect workflow definition.
|
147
147
|
|
148
|
-
!!! note
|
149
|
-
We recommend using the [`@flow` decorator][prefect.flows.flow] for most use-cases.
|
150
|
-
|
151
148
|
Wraps a function with an entrypoint to the Prefect engine. To preserve the input
|
152
149
|
and output types, we use the generic type variables `P` and `R` for "Parameters" and
|
153
150
|
"Returns" respectively.
|
@@ -500,23 +497,29 @@ class Flow(Generic[P, R]):
|
|
500
497
|
|
501
498
|
Create a new flow from an existing flow and update the name:
|
502
499
|
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
500
|
+
```python
|
501
|
+
from prefect import flow
|
502
|
+
|
503
|
+
@flow(name="My flow")
|
504
|
+
def my_flow():
|
505
|
+
return 1
|
506
|
+
|
507
|
+
new_flow = my_flow.with_options(name="My new flow")
|
508
|
+
```
|
508
509
|
|
509
510
|
Create a new flow from an existing flow, update the task runner, and call
|
510
511
|
it without an intermediate variable:
|
511
512
|
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
513
|
+
```python
|
514
|
+
from prefect.task_runners import ThreadPoolTaskRunner
|
515
|
+
|
516
|
+
@flow
|
517
|
+
def my_flow(x, y):
|
518
|
+
return x + y
|
519
|
+
|
520
|
+
state = my_flow.with_options(task_runner=ThreadPoolTaskRunner)(1, 3)
|
521
|
+
assert state.result() == 4
|
522
|
+
```
|
520
523
|
"""
|
521
524
|
new_task_runner = (
|
522
525
|
task_runner() if isinstance(task_runner, type) else task_runner
|
@@ -1653,22 +1656,27 @@ class Flow(Generic[P, R]):
|
|
1653
1656
|
|
1654
1657
|
Define a flow
|
1655
1658
|
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1659
|
+
```python
|
1660
|
+
@flow
|
1661
|
+
def my_flow(name):
|
1662
|
+
print(f"hello {name}")
|
1663
|
+
return f"goodbye {name}"
|
1664
|
+
```
|
1660
1665
|
|
1661
1666
|
Run a flow
|
1662
1667
|
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1668
|
+
```python
|
1669
|
+
my_flow("marvin")
|
1670
|
+
```
|
1666
1671
|
|
1667
1672
|
Run a flow with additional tags
|
1668
1673
|
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1674
|
+
```python
|
1675
|
+
from prefect import tags
|
1676
|
+
|
1677
|
+
with tags("db", "blue"):
|
1678
|
+
my_flow("foo")
|
1679
|
+
```
|
1672
1680
|
"""
|
1673
1681
|
from prefect.utilities.visualization import (
|
1674
1682
|
get_task_viz_tracker,
|
@@ -1907,36 +1915,47 @@ class FlowDecorator:
|
|
1907
1915
|
Examples:
|
1908
1916
|
Define a simple flow
|
1909
1917
|
|
1910
|
-
|
1911
|
-
|
1912
|
-
|
1913
|
-
|
1918
|
+
```python
|
1919
|
+
from prefect import flow
|
1920
|
+
|
1921
|
+
@flow
|
1922
|
+
def add(x, y):
|
1923
|
+
return x + y
|
1924
|
+
```
|
1914
1925
|
|
1915
1926
|
Define an async flow
|
1916
1927
|
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1928
|
+
```python
|
1929
|
+
@flow
|
1930
|
+
async def add(x, y):
|
1931
|
+
return x + y
|
1932
|
+
```
|
1920
1933
|
|
1921
1934
|
Define a flow with a version and description
|
1922
1935
|
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1936
|
+
```python
|
1937
|
+
@flow(version="first-flow", description="This flow is empty!")
|
1938
|
+
def my_flow():
|
1939
|
+
pass
|
1940
|
+
```
|
1926
1941
|
|
1927
1942
|
Define a flow with a custom name
|
1928
1943
|
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1944
|
+
```python
|
1945
|
+
@flow(name="The Ultimate Flow")
|
1946
|
+
def my_flow():
|
1947
|
+
pass
|
1948
|
+
```
|
1932
1949
|
|
1933
1950
|
Define a flow that submits its tasks to dask
|
1934
1951
|
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1952
|
+
```python
|
1953
|
+
from prefect_dask.task_runners import DaskTaskRunner
|
1954
|
+
|
1955
|
+
@flow(task_runner=DaskTaskRunner)
|
1956
|
+
def my_flow():
|
1957
|
+
pass
|
1958
|
+
```
|
1940
1959
|
"""
|
1941
1960
|
if __fn:
|
1942
1961
|
return Flow(
|
prefect/tasks.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
Module containing the base workflow task class and decorator - for most use cases, using the
|
2
|
+
Module containing the base workflow task class and decorator - for most use cases, using the `@task` decorator is preferred.
|
3
3
|
"""
|
4
4
|
|
5
5
|
# This file requires type-checking with pyright because mypy does not yet support PEP612
|
@@ -301,9 +301,6 @@ class Task(Generic[P, R]):
|
|
301
301
|
"""
|
302
302
|
A Prefect task definition.
|
303
303
|
|
304
|
-
!!! note
|
305
|
-
We recommend using [the `@task` decorator][prefect.tasks.task] for most use-cases.
|
306
|
-
|
307
304
|
Wraps a function with an entrypoint to the Prefect engine. Calling this class within a flow function
|
308
305
|
creates a new task run.
|
309
306
|
|
prefect/utilities/engine.py
CHANGED
@@ -333,8 +333,7 @@ async def propose_state(
|
|
333
333
|
flow_run_id: an optional flow run id, used when proposing flow run states
|
334
334
|
|
335
335
|
Returns:
|
336
|
-
a
|
337
|
-
flow run state
|
336
|
+
a State model representation of the flow run state
|
338
337
|
|
339
338
|
Raises:
|
340
339
|
prefect.exceptions.Abort: if an ABORT instruction is received from
|
@@ -432,8 +431,7 @@ def propose_state_sync(
|
|
432
431
|
flow_run_id: an optional flow run id, used when proposing flow run states
|
433
432
|
|
434
433
|
Returns:
|
435
|
-
a
|
436
|
-
flow run state
|
434
|
+
a State model representation of the flow run state
|
437
435
|
|
438
436
|
Raises:
|
439
437
|
ValueError: if flow_run_id is not provided
|
@@ -2,7 +2,7 @@ prefect/.prefectignore,sha256=awSprvKT0vI8a64mEOLrMxhxqcO-b0ERQeYpA2rNKVQ,390
|
|
2
2
|
prefect/AGENTS.md,sha256=qmCZAuKIF9jQyp5TrW_T8bsM_97-QaiCoQp71A_b2Lg,1008
|
3
3
|
prefect/__init__.py,sha256=iCdcC5ZmeewikCdnPEP6YBAjPNV5dvfxpYCTpw30Hkw,3685
|
4
4
|
prefect/__main__.py,sha256=WFjw3kaYJY6pOTA7WDOgqjsz8zUEUZHCcj3P5wyVa-g,66
|
5
|
-
prefect/_build_info.py,sha256=
|
5
|
+
prefect/_build_info.py,sha256=cJqOi7wQGRupy4Rsu7Su9cZXMkfbV29ES1HTg1M-8LQ,185
|
6
6
|
prefect/_result_records.py,sha256=S6QmsODkehGVSzbMm6ig022PYbI6gNKz671p_8kBYx4,7789
|
7
7
|
prefect/_versioning.py,sha256=YqR5cxXrY4P6LM1Pmhd8iMo7v_G2KJpGNdsf4EvDFQ0,14132
|
8
8
|
prefect/_waiters.py,sha256=Ia2ITaXdHzevtyWIgJoOg95lrEXQqNEOquHvw3T33UQ,9026
|
@@ -16,7 +16,7 @@ prefect/exceptions.py,sha256=wZLQQMRB_DyiYkeEdIC5OKwbba5A94Dlnics-lrWI7A,11581
|
|
16
16
|
prefect/filesystems.py,sha256=v5YqGB4uXf9Ew2VuB9VCSkawvYMMVvEtZf7w1VmAmr8,18036
|
17
17
|
prefect/flow_engine.py,sha256=JwnMqtrSgDVtsw4cyUOBkHhlNXhysb5SSNZtRe-NpqE,59100
|
18
18
|
prefect/flow_runs.py,sha256=d3jfmrIPP3C19IJREvpkuN6fxksX3Lzo-LlHOB-_E2I,17419
|
19
|
-
prefect/flows.py,sha256=
|
19
|
+
prefect/flows.py,sha256=zKmskX31aW8NlArC9QkbXsFGxatcdwQMIQe2PHHcDqQ,120984
|
20
20
|
prefect/futures.py,sha256=U1SdxwOWNdQz_xtlZ6J-_zjRntxbqu7kz53YRov-Dew,25000
|
21
21
|
prefect/main.py,sha256=8V-qLB4GjEVCkGRgGXeaIk-JIXY8Z9FozcNluj4Sm9E,2589
|
22
22
|
prefect/plugins.py,sha256=FPRLR2mWVBMuOnlzeiTD9krlHONZH2rtYLD753JQDNQ,2516
|
@@ -29,7 +29,7 @@ prefect/task_engine.py,sha256=-uGGvLnXVeGNzA3Hki6-epUEY00P3l3QBXTcahjfEM4,65506
|
|
29
29
|
prefect/task_runners.py,sha256=Mc9KIbY2uqxQcO1XHPh6hId0Qk1ukjCaGHCn4LKo3tg,17000
|
30
30
|
prefect/task_runs.py,sha256=7LIzfo3fondCyEUpU05sYFN5IfpZigBDXrhG5yc-8t0,9039
|
31
31
|
prefect/task_worker.py,sha256=RifZ3bOl6ppoYPiOAd4TQp2_GEw9eDQoW483rq1q52Q,20805
|
32
|
-
prefect/tasks.py,sha256=
|
32
|
+
prefect/tasks.py,sha256=CKPF22f_6L5jQFtGgykMdTsQqwF7OnfWu5jjn1F-bLw,78165
|
33
33
|
prefect/transactions.py,sha256=uIoPNudzJzH6NrMJhrgr5lyh6JxOJQqT1GvrXt69yNw,26068
|
34
34
|
prefect/variables.py,sha256=dCK3vX7TbkqXZhnNT_v7rcGh3ISRqoR6pJVLpoll3Js,8342
|
35
35
|
prefect/_experimental/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -107,11 +107,11 @@ prefect/client/orchestration/_blocks_types/client.py,sha256=alA4xD-yp3mycAbzMyRu
|
|
107
107
|
prefect/client/orchestration/_concurrency_limits/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
108
108
|
prefect/client/orchestration/_concurrency_limits/client.py,sha256=r_oyY7hQbgyG1rntwe7WWcsraQHBKhk6MOPFUAHWiVc,23678
|
109
109
|
prefect/client/orchestration/_deployments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
110
|
-
prefect/client/orchestration/_deployments/client.py,sha256=
|
110
|
+
prefect/client/orchestration/_deployments/client.py,sha256=h42dzlVStzTcmnXtQfIVoKTI3rarsJgoQeSKnTwGIyg,48387
|
111
111
|
prefect/client/orchestration/_flow_runs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
112
112
|
prefect/client/orchestration/_flow_runs/client.py,sha256=fjh5J-LG8tsny7BGYEvynbuGuHDAudYHpx-PamL0GYQ,32220
|
113
113
|
prefect/client/orchestration/_flows/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
114
|
-
prefect/client/orchestration/_flows/client.py,sha256=
|
114
|
+
prefect/client/orchestration/_flows/client.py,sha256=GLMT5qC_z-Ys7koz5UU5zYOPUOiXW7tUIBNgK7uY_Wc,10888
|
115
115
|
prefect/client/orchestration/_logs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
116
116
|
prefect/client/orchestration/_logs/client.py,sha256=DYgdeVV_6ORIOuqZapDWZXuFjIUtWreAyl2uHWpGZfA,2996
|
117
117
|
prefect/client/orchestration/_variables/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -120,7 +120,7 @@ prefect/client/orchestration/_work_pools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
|
|
120
120
|
prefect/client/orchestration/_work_pools/client.py,sha256=s1DfUQQBgB2sLiVVPhLNTlkueUDE6uFsh4mAzcSA1OE,19881
|
121
121
|
prefect/client/schemas/__init__.py,sha256=9eCE4tzSxsB-uhXNagrb78jz1xtI4QPoZuH6TNav8M4,2831
|
122
122
|
prefect/client/schemas/actions.py,sha256=R6WwzxBj1SuwUqGX0g6zEDxtdoNR7lTQLSpytP2HOgA,32482
|
123
|
-
prefect/client/schemas/filters.py,sha256=
|
123
|
+
prefect/client/schemas/filters.py,sha256=uEGvai0VtrvUtojFME-oflQ1T-Diw-TUrQwk4PwBOtU,36085
|
124
124
|
prefect/client/schemas/objects.py,sha256=vL1yN-IqQynpVH9Sp0-aYyTfRHfy3eIsLnTAfw6aCbI,58215
|
125
125
|
prefect/client/schemas/responses.py,sha256=Zdcx7jlIaluEa2uYIOE5mK1HsJvWPErRAcaWM20oY_I,17336
|
126
126
|
prefect/client/schemas/schedules.py,sha256=sxLFk0SmFY7X1Y9R9HyGDqOS3U5NINBWTciUU7vTTic,14836
|
@@ -302,7 +302,7 @@ prefect/utilities/compat.py,sha256=nnPA3lf2f4Y-l645tYFFNmj5NDPaYvjqa9pbGKZ3WKE,5
|
|
302
302
|
prefect/utilities/context.py,sha256=23SDMgdt07SjmB1qShiykHfGgiv55NBzdbMXM3fE9CI,1447
|
303
303
|
prefect/utilities/dispatch.py,sha256=u6GSGSO3_6vVoIqHVc849lsKkC-I1wUl6TX134GwRBo,6310
|
304
304
|
prefect/utilities/dockerutils.py,sha256=6DLVyzE195IzeQSWERiK1t3bDMnYBLe0zXIpMQ4r0c0,21659
|
305
|
-
prefect/utilities/engine.py,sha256=
|
305
|
+
prefect/utilities/engine.py,sha256=nMtKaTDOIbMbUmDR3PcA_BOjOFKuginmrOERwfzub04,28316
|
306
306
|
prefect/utilities/filesystem.py,sha256=Pwesv71PGFhf3lPa1iFyMqZZprBjy9nEKCVxTkf_hXw,5710
|
307
307
|
prefect/utilities/generics.py,sha256=o77e8a5iwmrisOf42wLp2WI9YvSw2xDW4vFdpdEwr3I,543
|
308
308
|
prefect/utilities/hashing.py,sha256=7jRy26s46IJAFRmVnCnoK9ek9N4p_UfXxQQvu2tW6dM,2589
|
@@ -329,7 +329,7 @@ prefect/workers/cloud.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
|
|
329
329
|
prefect/workers/process.py,sha256=Yi5D0U5AQ51wHT86GdwtImXSefe0gJf3LGq4r4z9zwM,11090
|
330
330
|
prefect/workers/server.py,sha256=2pmVeJZiVbEK02SO6BEZaBIvHMsn6G8LzjW8BXyiTtk,1952
|
331
331
|
prefect/workers/utilities.py,sha256=VfPfAlGtTuDj0-Kb8WlMgAuOfgXCdrGAnKMapPSBrwc,2483
|
332
|
-
prefect_client-3.4.7.
|
333
|
-
prefect_client-3.4.7.
|
334
|
-
prefect_client-3.4.7.
|
335
|
-
prefect_client-3.4.7.
|
332
|
+
prefect_client-3.4.7.dev7.dist-info/METADATA,sha256=YJvQqTJ9Dj42ijE5NXHSfOkx0rZ7cSaNJyaRanfYQE8,7517
|
333
|
+
prefect_client-3.4.7.dev7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
334
|
+
prefect_client-3.4.7.dev7.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
|
335
|
+
prefect_client-3.4.7.dev7.dist-info/RECORD,,
|
File without changes
|
{prefect_client-3.4.7.dev6.dist-info → prefect_client-3.4.7.dev7.dist-info}/licenses/LICENSE
RENAMED
File without changes
|