prefect-client 2.20.15__py3-none-any.whl → 2.20.16__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/client/orchestration.py +34 -2
- prefect/client/schemas/objects.py +3 -0
- prefect/tasks.py +4 -0
- {prefect_client-2.20.15.dist-info → prefect_client-2.20.16.dist-info}/METADATA +1 -1
- {prefect_client-2.20.15.dist-info → prefect_client-2.20.16.dist-info}/RECORD +8 -8
- {prefect_client-2.20.15.dist-info → prefect_client-2.20.16.dist-info}/LICENSE +0 -0
- {prefect_client-2.20.15.dist-info → prefect_client-2.20.16.dist-info}/WHEEL +0 -0
- {prefect_client-2.20.15.dist-info → prefect_client-2.20.16.dist-info}/top_level.txt +0 -0
prefect/client/orchestration.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import asyncio
|
2
2
|
import datetime
|
3
|
+
import ssl
|
3
4
|
import warnings
|
4
5
|
from contextlib import AsyncExitStack
|
5
6
|
from typing import (
|
@@ -275,12 +276,18 @@ class PrefectClient:
|
|
275
276
|
httpx_settings.setdefault("headers", {})
|
276
277
|
|
277
278
|
if PREFECT_API_TLS_INSECURE_SKIP_VERIFY:
|
278
|
-
|
279
|
+
# Create an unverified context for insecure connections
|
280
|
+
ctx = ssl.create_default_context()
|
281
|
+
ctx.check_hostname = False
|
282
|
+
ctx.verify_mode = ssl.CERT_NONE
|
283
|
+
httpx_settings.setdefault("verify", ctx)
|
279
284
|
else:
|
280
285
|
cert_file = PREFECT_API_SSL_CERT_FILE.value()
|
281
286
|
if not cert_file:
|
282
287
|
cert_file = certifi.where()
|
283
|
-
|
288
|
+
# Create a verified context with the certificate file
|
289
|
+
ctx = ssl.create_default_context(cafile=cert_file)
|
290
|
+
httpx_settings.setdefault("verify", ctx)
|
284
291
|
|
285
292
|
if api_version is None:
|
286
293
|
api_version = SERVER_API_VERSION
|
@@ -492,6 +499,23 @@ class PrefectClient:
|
|
492
499
|
response = await self._client.get(f"/flows/{flow_id}")
|
493
500
|
return Flow.parse_obj(response.json())
|
494
501
|
|
502
|
+
async def delete_flow(self, flow_id: UUID) -> None:
|
503
|
+
"""
|
504
|
+
Delete a flow by UUID.
|
505
|
+
Args:
|
506
|
+
flow_id: ID of the flow to be deleted
|
507
|
+
Raises:
|
508
|
+
prefect.exceptions.ObjectNotFound: If request returns 404
|
509
|
+
httpx.RequestError: If requests fails
|
510
|
+
"""
|
511
|
+
try:
|
512
|
+
await self._client.delete(f"/flows/{flow_id}")
|
513
|
+
except httpx.HTTPStatusError as e:
|
514
|
+
if e.response.status_code == status.HTTP_404_NOT_FOUND:
|
515
|
+
raise prefect.exceptions.ObjectNotFound(http_exc=e) from e
|
516
|
+
else:
|
517
|
+
raise
|
518
|
+
|
495
519
|
async def read_flows(
|
496
520
|
self,
|
497
521
|
*,
|
@@ -3438,11 +3462,19 @@ class SyncPrefectClient:
|
|
3438
3462
|
|
3439
3463
|
if PREFECT_API_TLS_INSECURE_SKIP_VERIFY:
|
3440
3464
|
httpx_settings.setdefault("verify", False)
|
3465
|
+
# Create an unverified context for insecure connections
|
3466
|
+
ctx = ssl.create_default_context()
|
3467
|
+
ctx.check_hostname = False
|
3468
|
+
ctx.verify_mode = ssl.CERT_NONE
|
3469
|
+
httpx_settings.setdefault("verify", ctx)
|
3441
3470
|
else:
|
3442
3471
|
cert_file = PREFECT_API_SSL_CERT_FILE.value()
|
3443
3472
|
if not cert_file:
|
3444
3473
|
cert_file = certifi.where()
|
3445
3474
|
httpx_settings.setdefault("verify", cert_file)
|
3475
|
+
# Create a verified context with the certificate file
|
3476
|
+
ctx = ssl.create_default_context(cafile=cert_file)
|
3477
|
+
httpx_settings.setdefault("verify", ctx)
|
3446
3478
|
|
3447
3479
|
if api_version is None:
|
3448
3480
|
api_version = SERVER_API_VERSION
|
@@ -410,6 +410,9 @@ class FlowRunPolicy(PrefectBaseModel):
|
|
410
410
|
resuming: Optional[bool] = Field(
|
411
411
|
default=False, description="Indicates if this run is resuming from a pause."
|
412
412
|
)
|
413
|
+
retry_type: Optional[Literal["in_process", "reschedule"]] = Field(
|
414
|
+
default=None, description="The type of retry this run is undergoing."
|
415
|
+
)
|
413
416
|
|
414
417
|
@root_validator
|
415
418
|
def populate_deprecated_fields(cls, values):
|
prefect/tasks.py
CHANGED
@@ -342,6 +342,10 @@ class Task(Generic[P, R]):
|
|
342
342
|
|
343
343
|
if callable(retry_delay_seconds):
|
344
344
|
self.retry_delay_seconds = retry_delay_seconds(retries)
|
345
|
+
elif not isinstance(retry_delay_seconds, (list, int, float, type(None))):
|
346
|
+
raise TypeError(
|
347
|
+
f"Invalid `retry_delay_seconds` provided; must be an int, float, list or callable. Received type {type(retry_delay_seconds)}"
|
348
|
+
)
|
345
349
|
else:
|
346
350
|
self.retry_delay_seconds = retry_delay_seconds
|
347
351
|
|
@@ -24,7 +24,7 @@ prefect/states.py,sha256=B38zIXnqc8cmw3GPxmMQ4thX6pXb6UtG4PoTZ5thGQs,21036
|
|
24
24
|
prefect/task_engine.py,sha256=_2I7XLwoT_nNhpzTMa_52aQKjsDoaW6WpzwIHYEWZS0,2598
|
25
25
|
prefect/task_runners.py,sha256=HXUg5UqhZRN2QNBqMdGE1lKhwFhT8TaRN75ScgLbnw8,11012
|
26
26
|
prefect/task_server.py,sha256=-wHuAlY8DLEQuJcEvcFfB4da0Xdnmqk6D7GjHShh-Ik,11668
|
27
|
-
prefect/tasks.py,sha256=
|
27
|
+
prefect/tasks.py,sha256=6a_w3RWcTGmW3iZMzH-gFhvWLBp0-aw3j0ktnFZKCwc,56706
|
28
28
|
prefect/variables.py,sha256=woS7idyYxCJ4BJ6AVitcfb_Db7CReFg7KLqW5hc685w,4014
|
29
29
|
prefect/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
30
|
prefect/_internal/_logging.py,sha256=HvNHY-8P469o5u4LYEDBTem69XZEt1QUeUaLToijpak,810
|
@@ -167,13 +167,13 @@ prefect/client/base.py,sha256=YSPeE7hV0NCuD6WzoAACDYGFK4Yq35d26pITZ3elNyY,24669
|
|
167
167
|
prefect/client/cloud.py,sha256=E54OAFr7bY5IXhhMBdjGwLQiR0eU-WWFoEEiOq2l53I,4104
|
168
168
|
prefect/client/collections.py,sha256=I9EgbTg4Fn57gn8vwP_WdDmgnATbx9gfkm2jjhCORjw,1037
|
169
169
|
prefect/client/constants.py,sha256=Z_GG8KF70vbbXxpJuqW5pLnwzujTVeHbcYYRikNmGH0,29
|
170
|
-
prefect/client/orchestration.py,sha256=
|
170
|
+
prefect/client/orchestration.py,sha256=rGIIJe1c9HhJSOj7ZdROz8Mnoj9qnDBuwzYjxygEqtk,141876
|
171
171
|
prefect/client/subscriptions.py,sha256=3kqPH3F-CwyrR5wygCpJMjRjM_gcQjd54Qjih6FcLlA,3372
|
172
172
|
prefect/client/utilities.py,sha256=7V4IkfC8x_OZuPXGvtIMmwZCOW63hSY8iVQkuRYTR6g,3079
|
173
173
|
prefect/client/schemas/__init__.py,sha256=KlyqFV-hMulMkNstBn_0ijoHoIwJZaBj6B1r07UmgvE,607
|
174
174
|
prefect/client/schemas/actions.py,sha256=4mq1OXMsXs6aGlXg1G232RNcn0ivAOIgikL0IKs6S-E,27943
|
175
175
|
prefect/client/schemas/filters.py,sha256=gv57m0bHJqL7Ifsc_vAdRODFomaMVcrGXKAahOSBU4w,35598
|
176
|
-
prefect/client/schemas/objects.py,sha256=
|
176
|
+
prefect/client/schemas/objects.py,sha256=V3UQCXpgh2xgxIN6wjzXbm-tSCjB9cOIH8yei9sDT4E,53464
|
177
177
|
prefect/client/schemas/responses.py,sha256=XAc95g3PRL9UIkH9_VMuv0ECHKdc19guBLmdt5KefkI,15325
|
178
178
|
prefect/client/schemas/schedules.py,sha256=ZF7fFbkcc8rVdx2MxE8DR0av3FUE9qDPjLreEuV8HfM,12193
|
179
179
|
prefect/client/schemas/sorting.py,sha256=EIQ6FUjUWMwk6fn6ckVLQLXOP-GI5kce7ftjUkDFWV0,2490
|
@@ -289,8 +289,8 @@ prefect/workers/block.py,sha256=aYY__uq3v1eq1kkbVukxyhQNbkknaKYo6-_3tcrfKKA,8067
|
|
289
289
|
prefect/workers/process.py,sha256=pPtCdA7fKQ4OsvoitT-cayZeh5HgLX4xBUYlb2Zad-Q,9475
|
290
290
|
prefect/workers/server.py,sha256=WVZJxR8nTMzK0ov0BD0xw5OyQpT26AxlXbsGQ1OrxeQ,1551
|
291
291
|
prefect/workers/utilities.py,sha256=VfPfAlGtTuDj0-Kb8WlMgAuOfgXCdrGAnKMapPSBrwc,2483
|
292
|
-
prefect_client-2.20.
|
293
|
-
prefect_client-2.20.
|
294
|
-
prefect_client-2.20.
|
295
|
-
prefect_client-2.20.
|
296
|
-
prefect_client-2.20.
|
292
|
+
prefect_client-2.20.16.dist-info/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
|
293
|
+
prefect_client-2.20.16.dist-info/METADATA,sha256=YEumdbpwNB9VuTz0z6G43vx6LXaOCqctKgTGcAEwWqA,7392
|
294
|
+
prefect_client-2.20.16.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
295
|
+
prefect_client-2.20.16.dist-info/top_level.txt,sha256=MJZYJgFdbRc2woQCeB4vM6T33tr01TmkEhRcns6H_H4,8
|
296
|
+
prefect_client-2.20.16.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|