prefect-client 3.4.2.dev4__py3-none-any.whl → 3.4.3.dev1__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 CHANGED
@@ -1,5 +1,5 @@
1
1
  # Generated by versioningit
2
- __version__ = "3.4.2.dev4"
3
- __build_date__ = "2025-05-15 08:08:41.435561+00:00"
4
- __git_commit__ = "95a0ccedd4626c1a737d41a2d4aac25072d606cd"
2
+ __version__ = "3.4.3.dev1"
3
+ __build_date__ = "2025-05-20 08:09:25.169022+00:00"
4
+ __git_commit__ = "26c5fa05c23e2bffcdb97596e083a490352e332d"
5
5
  __dirty__ = False
prefect/blocks/webhook.py CHANGED
@@ -58,7 +58,7 @@ class Webhook(Block):
58
58
  else:
59
59
  self._client = AsyncClient(transport=_insecure_http_transport)
60
60
 
61
- async def call(self, payload: dict[str, Any] | None = None) -> Response:
61
+ async def call(self, payload: dict[str, Any] | str | None = None) -> Response:
62
62
  """
63
63
  Call the webhook.
64
64
 
@@ -69,9 +69,17 @@ class Webhook(Block):
69
69
  validate_restricted_url(self.url.get_secret_value())
70
70
 
71
71
  async with self._client:
72
- return await self._client.request(
73
- method=self.method,
74
- url=self.url.get_secret_value(),
75
- headers=self.headers.get_secret_value(),
76
- json=payload,
77
- )
72
+ if isinstance(payload, str):
73
+ return await self._client.request(
74
+ method=self.method,
75
+ url=self.url.get_secret_value(),
76
+ headers=self.headers.get_secret_value(),
77
+ content=payload,
78
+ )
79
+ else:
80
+ return await self._client.request(
81
+ method=self.method,
82
+ url=self.url.get_secret_value(),
83
+ headers=self.headers.get_secret_value(),
84
+ json=payload,
85
+ )
@@ -743,7 +743,9 @@ class RunnerDeployment(BaseModel):
743
743
  entry_path = (
744
744
  Path(flow_file).absolute().relative_to(Path.cwd().absolute())
745
745
  )
746
- deployment.entrypoint = f"{entry_path}:{flow.fn.__name__}"
746
+ deployment.entrypoint = (
747
+ f"{entry_path}:{getattr(flow.fn, '__qualname__', flow.fn.__name__)}"
748
+ )
747
749
 
748
750
  if entrypoint_type == EntrypointType.FILE_PATH and not deployment._path:
749
751
  deployment._path = "."
prefect/flows.py CHANGED
@@ -404,7 +404,7 @@ class Flow(Generic[P, R]):
404
404
  module_name = inspect.getfile(fn)
405
405
  module = module_name if module_name != "__main__" else module
406
406
 
407
- self._entrypoint = f"{module}:{fn.__name__}"
407
+ self._entrypoint = f"{module}:{getattr(fn, '__qualname__', fn.__name__)}"
408
408
 
409
409
  @property
410
410
  def ismethod(self) -> bool:
@@ -54,7 +54,10 @@ def load_logging_config(path: Path) -> dict[str, Any]:
54
54
  to_envvar("PREFECT_LOGGING_" + "_".join(key_tup)).upper()
55
55
  )
56
56
  if env_val:
57
- val = env_val
57
+ if isinstance(val, list):
58
+ val = env_val.split(",")
59
+ else:
60
+ val = env_val
58
61
 
59
62
  # reassign the updated value
60
63
  flat_config[key_tup] = val
@@ -2,7 +2,8 @@
2
2
  #
3
3
  # Any item in this file can be overridden with an environment variable:
4
4
  # `PREFECT_LOGGING_[PATH]_[TO]_[KEY]=VALUE`
5
- #
5
+ # List items can be overridden with a comma-separated list:
6
+ # `PREFECT_LOGGING_[PATH]_[TO]_[KEY]=item1,item2,item3`
6
7
  # Templated values can be used to insert values from the Prefect settings at runtime.
7
8
 
8
9
  version: 1
prefect/runner/runner.py CHANGED
@@ -968,16 +968,9 @@ class Runner:
968
968
 
969
969
  pid = process_map_entry.get("pid") if process_map_entry else None
970
970
  if not pid:
971
- if flow_run.state:
972
- await self._run_on_cancellation_hooks(flow_run, flow_run.state)
973
- await self._mark_flow_run_as_cancelled(
974
- flow_run,
975
- state_updates={
976
- "message": (
977
- "Could not find process ID for flow run"
978
- " and cancellation cannot be guaranteed."
979
- )
980
- },
971
+ self._logger.debug(
972
+ "Received cancellation request for flow run %s but no process was found.",
973
+ flow_run.id,
981
974
  )
982
975
  return
983
976
 
prefect/serializers.py CHANGED
@@ -12,6 +12,7 @@ bytes to an object respectively.
12
12
  """
13
13
 
14
14
  import base64
15
+ import io
15
16
  from typing import Any, ClassVar, Generic, Optional, Union, overload
16
17
 
17
18
  from pydantic import (
@@ -46,6 +47,14 @@ def prefect_json_object_encoder(obj: Any) -> Any:
46
47
  """
47
48
  if isinstance(obj, BaseException):
48
49
  return {"__exc_type__": to_qualified_name(obj.__class__), "message": str(obj)}
50
+ elif isinstance(obj, io.IOBase):
51
+ return {
52
+ "__class__": to_qualified_name(obj.__class__),
53
+ "data": (
54
+ f"<Prefect IOStream Placeholder: type={obj.__class__.__name__}, "
55
+ f"repr={repr(obj)} (original content not read)>"
56
+ ),
57
+ }
49
58
  else:
50
59
  return {
51
60
  "__class__": to_qualified_name(obj.__class__),
@@ -15,6 +15,42 @@ from typing_extensions import Literal, Self
15
15
  from prefect.settings.base import PrefectBaseSettings, build_settings_config
16
16
 
17
17
 
18
+ class SQLAlchemyTLSSettings(PrefectBaseSettings):
19
+ """
20
+ Settings for controlling SQLAlchemy mTLS context when
21
+ using a PostgreSQL database.
22
+ """
23
+
24
+ model_config: ClassVar[SettingsConfigDict] = build_settings_config(
25
+ ("server", "database", "sqlalchemy", "connect_args", "tls")
26
+ )
27
+
28
+ enabled: bool = Field(
29
+ default=False,
30
+ description="Controls whether connected to mTLS enabled PostgreSQL when using a PostgreSQL database with the Prefect backend.",
31
+ )
32
+
33
+ ca_file: Optional[str] = Field(
34
+ default=None,
35
+ description="This configuration settings option specifies the path to PostgreSQL client certificate authority file.",
36
+ )
37
+
38
+ cert_file: Optional[str] = Field(
39
+ default=None,
40
+ description="This configuration settings option specifies the path to PostgreSQL client certificate file.",
41
+ )
42
+
43
+ key_file: Optional[str] = Field(
44
+ default=None,
45
+ description="This configuration settings option specifies the path to PostgreSQL client key file.",
46
+ )
47
+
48
+ check_hostname: bool = Field(
49
+ default=True,
50
+ description="This configuration settings option specifies whether to verify PostgreSQL server hostname.",
51
+ )
52
+
53
+
18
54
  class SQLAlchemyConnectArgsSettings(PrefectBaseSettings):
19
55
  """
20
56
  Settings for controlling SQLAlchemy connection behavior; note that these settings only take effect when
@@ -44,6 +80,11 @@ class SQLAlchemyConnectArgsSettings(PrefectBaseSettings):
44
80
  ),
45
81
  )
46
82
 
83
+ tls: SQLAlchemyTLSSettings = Field(
84
+ default_factory=SQLAlchemyTLSSettings,
85
+ description="Settings for controlling SQLAlchemy mTLS behavior",
86
+ )
87
+
47
88
 
48
89
  class SQLAlchemySettings(PrefectBaseSettings):
49
90
  """
@@ -424,6 +424,10 @@ def generate_parameter_schema(
424
424
  name, type_, field = process_params(
425
425
  param, position=position, docstrings=docstrings, aliases=aliases
426
426
  )
427
+
428
+ if name == "cls":
429
+ continue # Exclude 'cls' as it's implicitly passed to @classmethod and not a real flow parameter
430
+
427
431
  # Generate a Pydantic model at each step so we can check if this parameter
428
432
  # type supports schema generation
429
433
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prefect-client
3
- Version: 3.4.2.dev4
3
+ Version: 3.4.3.dev1
4
4
  Summary: Workflow orchestration and management.
5
5
  Project-URL: Changelog, https://github.com/PrefectHQ/prefect/releases
6
6
  Project-URL: Documentation, https://docs.prefect.io
@@ -1,7 +1,7 @@
1
1
  prefect/.prefectignore,sha256=awSprvKT0vI8a64mEOLrMxhxqcO-b0ERQeYpA2rNKVQ,390
2
2
  prefect/__init__.py,sha256=iCdcC5ZmeewikCdnPEP6YBAjPNV5dvfxpYCTpw30Hkw,3685
3
3
  prefect/__main__.py,sha256=WFjw3kaYJY6pOTA7WDOgqjsz8zUEUZHCcj3P5wyVa-g,66
4
- prefect/_build_info.py,sha256=P8ooaLFwUGxqdTFcqMCGVVQxNCxM6bWPYjgBtmOkrpg,185
4
+ prefect/_build_info.py,sha256=rzOlNurTt9-Qg7Zf7Y_pzpiHVM854SAB5p9-MJ9a_pM,185
5
5
  prefect/_result_records.py,sha256=S6QmsODkehGVSzbMm6ig022PYbI6gNKz671p_8kBYx4,7789
6
6
  prefect/_versioning.py,sha256=YqR5cxXrY4P6LM1Pmhd8iMo7v_G2KJpGNdsf4EvDFQ0,14132
7
7
  prefect/_waiters.py,sha256=Ia2ITaXdHzevtyWIgJoOg95lrEXQqNEOquHvw3T33UQ,9026
@@ -15,14 +15,14 @@ prefect/exceptions.py,sha256=wZLQQMRB_DyiYkeEdIC5OKwbba5A94Dlnics-lrWI7A,11581
15
15
  prefect/filesystems.py,sha256=v5YqGB4uXf9Ew2VuB9VCSkawvYMMVvEtZf7w1VmAmr8,18036
16
16
  prefect/flow_engine.py,sha256=hZpTYEtwTPMtwVoTCrfD93igN7rlKeG_0kyCvdU4aYE,58876
17
17
  prefect/flow_runs.py,sha256=d3jfmrIPP3C19IJREvpkuN6fxksX3Lzo-LlHOB-_E2I,17419
18
- prefect/flows.py,sha256=3dm4IjIpoKHqgdQACeZPvqbqoRd7XjSnsCyOC3nm5H8,120916
18
+ prefect/flows.py,sha256=xJKlXgVVdlZh45uE73PjA90qqmArVM2hzHgsniu02CY,120945
19
19
  prefect/futures.py,sha256=5wVHLtniwG2au0zuxM-ucqo08x0B5l6e8Z1Swbe8R9s,23720
20
20
  prefect/main.py,sha256=8V-qLB4GjEVCkGRgGXeaIk-JIXY8Z9FozcNluj4Sm9E,2589
21
21
  prefect/plugins.py,sha256=FPRLR2mWVBMuOnlzeiTD9krlHONZH2rtYLD753JQDNQ,2516
22
22
  prefect/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  prefect/results.py,sha256=Amm3TQu8U_oakSn__tCogIJ5DsTj0w_kLzuENWsxK6A,36824
24
24
  prefect/schedules.py,sha256=dhq4OhImRvcmtxF7UH1m8RbwYdHT5RQsp_FrxVXfODE,7289
25
- prefect/serializers.py,sha256=QI0oEal_BO4HQaWSjr6ReSwT55Hn4sbSOXxGgQI1-y0,9249
25
+ prefect/serializers.py,sha256=lU9A1rGEfAfhr8nTl3rf-K7ED78QNShXOrmRBhgNk3Y,9566
26
26
  prefect/states.py,sha256=rh7l1bnIYpTXdlXt5nnpz66y9KLjBWAJrN9Eo5RwgQs,26023
27
27
  prefect/task_engine.py,sha256=j0rr8IyBinJmKPD-486RYWKZakhifkEE9ppPCJ9Es-U,62463
28
28
  prefect/task_runners.py,sha256=PozMYXXjiy5pMStifjdBTnLRTtP9uRuBa86KgafpPkQ,16243
@@ -78,7 +78,7 @@ prefect/blocks/fields.py,sha256=1m507VVmkpOnMF_7N-qboRjtw4_ceIuDneX3jZ3Jm54,63
78
78
  prefect/blocks/notifications.py,sha256=UpNNxc4Bwx0nSlDj-vZQOv2XyUCUB2PaO4uBPO1Y6XM,34162
79
79
  prefect/blocks/redis.py,sha256=lt_f1SIcS5OVvthCY6KRWiy5DyUZNRlHqkKhKF25P8c,5770
80
80
  prefect/blocks/system.py,sha256=4KiUIy5zizMqfGJrxvi9GLRLcMj4BjAXARxCUEmgbKI,5041
81
- prefect/blocks/webhook.py,sha256=hRpMGamOpS2HSM0iPU2ylVGnDWtWUPo6sIU3O24lIa0,2558
81
+ prefect/blocks/webhook.py,sha256=xylFigbDOsn-YzxahkTzNqYwrIA7wwS6204P0goLY3A,2907
82
82
  prefect/client/__init__.py,sha256=bDeOC_I8_la5dwCAfxKzYSTSAr2tlq5HpxJgVoCCdAs,675
83
83
  prefect/client/base.py,sha256=7VAMyoy8KtmtI-H8KYsI16_uw9TlrXSrcxChFuMp65Q,26269
84
84
  prefect/client/cloud.py,sha256=jnFgg0osMVDGbLjdWkDX3rQg_0pI_zvfSlU480XCWGQ,6523
@@ -140,7 +140,7 @@ prefect/deployments/__init__.py,sha256=_wb7NxDKhq11z9MjYsPckmT3o6MRhGLRgCV9TmvYt
140
140
  prefect/deployments/base.py,sha256=YY7g8MN6qzjNEjEA8wQXPxCrd47WnACIUeSRtI4nrEk,11849
141
141
  prefect/deployments/deployments.py,sha256=K3Rgnpjxo_T8I8LMwlq24OKqZiZBTE8-YnPg-YGUStM,171
142
142
  prefect/deployments/flow_runs.py,sha256=NYe-Bphsy6ENLqSSfywQuX5cRZt-uVgzqGmOsf3Sqw4,7643
143
- prefect/deployments/runner.py,sha256=SyhFJTdllbml2a1niuR6zfkngTbudGSfTaKvMtaHtEg,56622
143
+ prefect/deployments/runner.py,sha256=kNEPRbcMMtJi4ahtMwqL5SZto63Mfl8UIW3Omp8VKVY,56696
144
144
  prefect/deployments/schedules.py,sha256=2eL1-w8qXtwKVkgfUK7cuamwpKK3X6tN1QYTDa_gWxU,2190
145
145
  prefect/deployments/steps/__init__.py,sha256=Dlz9VqMRyG1Gal8dj8vfGpPr0LyQhZdvcciozkK8WoY,206
146
146
  prefect/deployments/steps/core.py,sha256=ulSgBFSx1lhBt1fP-UxebrernkumBDlympR6IPffV1g,6900
@@ -178,16 +178,16 @@ prefect/locking/filesystem.py,sha256=RVE4_5lgKi1iea0NZVQlyct5GU4fVAtCPPEdRMDaQHw
178
178
  prefect/locking/memory.py,sha256=EFQnhAO94jEy4TyS880DbsJ42CHT5WNuNc6Wj8dYrKc,7842
179
179
  prefect/locking/protocol.py,sha256=RsfvlaHTTEJ0YvYWSqFGoZuT2w4FPPxyQlHqjoyNGuE,4240
180
180
  prefect/logging/__init__.py,sha256=DpRZzZeWeiDHFlMDEQdknRzbxpL0ObFh5IqqS9iaZwQ,170
181
- prefect/logging/configuration.py,sha256=ZBAOgwE34VSZFSiP4gBEd0S9m645_mEs3dFhiwPj58o,3303
181
+ prefect/logging/configuration.py,sha256=go9lA4W5HMpK6azDz_ez2YqgQ2b3aCFXxJH-AopoHy8,3404
182
182
  prefect/logging/filters.py,sha256=NnRYubh9dMmWcCAjuW32cIVQ37rLxdn8ci26wTtQMyU,1136
183
183
  prefect/logging/formatters.py,sha256=Sum42BmYZ7mns64jSOy4OA_K8KudEZjeG2h7SZcY9mA,4167
184
184
  prefect/logging/handlers.py,sha256=NlaiRvFD2dMueIyRoy07xhEa6Ns-CNxdWeKeARF0YMQ,12842
185
185
  prefect/logging/highlighters.py,sha256=BCf_LNhFInIfGPqwuu8YVrGa4wVxNc4YXo2pYgftpg4,1811
186
186
  prefect/logging/loggers.py,sha256=rwFJv0i3dhdKr25XX-xUkQy4Vv4dy18bTy366jrC0OQ,12741
187
- prefect/logging/logging.yml,sha256=tT7gTyC4NmngFSqFkCdHaw7R0GPNPDDsTCGZQByiJAQ,3169
187
+ prefect/logging/logging.yml,sha256=G5hFJ57Vawz40_w8tDdhqq00dp103OvVDVmWrSQeQcQ,3285
188
188
  prefect/runner/__init__.py,sha256=pQBd9wVrUVUDUFJlgiweKSnbahoBZwqnd2O2jkhrULY,158
189
189
  prefect/runner/_observers.py,sha256=PpyXQL5bjp86AnDFEzcFPS5ayL6ExqcYgyuBMMQCO9Q,2183
190
- prefect/runner/runner.py,sha256=04-SK3rP4nd2PLNs5wSiRbtycnq7Lds8cBsWWM6V6NM,59865
190
+ prefect/runner/runner.py,sha256=q_3l2awvZATTTgVW3MYiElWHRWw5_ZIliUN9Ltt9d9M,59591
191
191
  prefect/runner/server.py,sha256=YRYFNoYddA9XfiTIYtudxrnD1vCX-PaOLhvyGUOb9AQ,11966
192
192
  prefect/runner/storage.py,sha256=n-65YoEf7KNVInnmMPeP5TVFJOa2zOS8w9en9MHi6uo,31328
193
193
  prefect/runner/submit.py,sha256=qOEj-NChQ6RYFV35hHEVMTklrNmKwaGs2mR78ku9H0o,9474
@@ -262,7 +262,7 @@ prefect/settings/models/testing.py,sha256=j9YH_WkB14iEzOjUtTmvY978qRSbgCypFSEi_c
262
262
  prefect/settings/models/worker.py,sha256=zeDU71aR4CEvEOKyH-1jgEyol8XYe29PExjIC6a8Wv0,1378
263
263
  prefect/settings/models/server/__init__.py,sha256=KJmffmlHb8GYnClaeYcerae-IaeNsNMucKKRRS_zG9Q,33
264
264
  prefect/settings/models/server/api.py,sha256=fhj9pt6RGtUHkyriaTPto4NnOwJD4XWLdIyxuiJ2Dzk,5202
265
- prefect/settings/models/server/database.py,sha256=Ilw452gS4L1L4tk53JP-G080JblPVdWzdSVxhfuXcXQ,11156
265
+ prefect/settings/models/server/database.py,sha256=-WvY4u-eatXmicQEAAyJCJfOVNK0SqU6O3GeI1TuRks,12547
266
266
  prefect/settings/models/server/deployments.py,sha256=LjWQr2U1mjItYhuuLqMT_QQ7P4KHqC-tKFfA-rEKefs,898
267
267
  prefect/settings/models/server/ephemeral.py,sha256=rh8Py5Nxh-gq9KgfB7CDnIgT_nuOuv59OrLGuhMIGmk,1043
268
268
  prefect/settings/models/server/events.py,sha256=9rdlbLz9SIg_easm1UcFTfX1seS935Xtv5d9y3r39Eo,5578
@@ -289,7 +289,7 @@ prefect/utilities/_engine.py,sha256=9GW4X1lyAbmPwCuXXIubVJ7Z0DMT3dykkEUtp9tm5hI,
289
289
  prefect/utilities/_git.py,sha256=bPYWQdr9xvH0BqxR1ll1RkaSb3x0vhwylhYD5EilkKU,863
290
290
  prefect/utilities/annotations.py,sha256=0Elqgq6LR7pQqezNqT5wb6U_0e2pDO_zx6VseVL6kL8,4396
291
291
  prefect/utilities/asyncutils.py,sha256=xcfeNym2j3WH4gKXznON2hI1PpUTcwr_BGc16IQS3C4,19789
292
- prefect/utilities/callables.py,sha256=xK1zWWcNPkFM4a0Yq8MaMyx9p_4F74DnDYoQ8zEkzZI,25835
292
+ prefect/utilities/callables.py,sha256=IaL-RBlrxmP7_zwwLNb2-F_Ht3o4KXUr6Pi2eVCH4rk,25973
293
293
  prefect/utilities/collections.py,sha256=c3nPLPWqIZQQdNuHs_nrbQJwuhQSX4ivUl-h9LtzXto,23243
294
294
  prefect/utilities/compat.py,sha256=nnPA3lf2f4Y-l645tYFFNmj5NDPaYvjqa9pbGKZ3WKE,582
295
295
  prefect/utilities/context.py,sha256=23SDMgdt07SjmB1qShiykHfGgiv55NBzdbMXM3fE9CI,1447
@@ -322,7 +322,7 @@ prefect/workers/cloud.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
322
322
  prefect/workers/process.py,sha256=Yi5D0U5AQ51wHT86GdwtImXSefe0gJf3LGq4r4z9zwM,11090
323
323
  prefect/workers/server.py,sha256=2pmVeJZiVbEK02SO6BEZaBIvHMsn6G8LzjW8BXyiTtk,1952
324
324
  prefect/workers/utilities.py,sha256=VfPfAlGtTuDj0-Kb8WlMgAuOfgXCdrGAnKMapPSBrwc,2483
325
- prefect_client-3.4.2.dev4.dist-info/METADATA,sha256=GE5cL6rlM6zIdDIgEDwxk63FuE2YcLy6T2kb3fHqMyc,7472
326
- prefect_client-3.4.2.dev4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
327
- prefect_client-3.4.2.dev4.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
328
- prefect_client-3.4.2.dev4.dist-info/RECORD,,
325
+ prefect_client-3.4.3.dev1.dist-info/METADATA,sha256=h3fL8prYMzEXZx41JfPYWC2x-QzQHZEnJ2XlETxI9Lg,7472
326
+ prefect_client-3.4.3.dev1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
327
+ prefect_client-3.4.3.dev1.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
328
+ prefect_client-3.4.3.dev1.dist-info/RECORD,,