prefect-client 3.4.5.dev2__py3-none-any.whl → 3.4.5.dev3__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.5.dev2"
3
- __build_date__ = "2025-06-03 08:09:38.302110+00:00"
4
- __git_commit__ = "b7df9a27ddd37edda11b2406cf4506890f0de598"
2
+ __version__ = "3.4.5.dev3"
3
+ __build_date__ = "2025-06-04 08:09:28.476743+00:00"
4
+ __git_commit__ = "5fa9936c7a1638db9eb9c5cf45ff19a05a47c692"
5
5
  __dirty__ = False
@@ -927,12 +927,31 @@ class SendgridEmail(AbstractAppriseNotificationBlock):
927
927
  NotifySendGrid, # pyright: ignore[reportUnknownVariableType] incomplete type hints in apprise
928
928
  )
929
929
 
930
- url = SecretStr(
931
- NotifySendGrid(
930
+ self._NotifySendGrid = NotifySendGrid # Cache the working import
931
+ url = self._build_sendgrid_url()
932
+ self._start_apprise_client(url)
933
+
934
+ def _build_sendgrid_url(self) -> SecretStr:
935
+ """Build the SendGrid URL with current to_emails."""
936
+ return SecretStr(
937
+ self._NotifySendGrid(
932
938
  apikey=self.api_key.get_secret_value(),
933
939
  from_email=self.sender_email,
934
940
  targets=self.to_emails,
935
941
  ).url() # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] incomplete type hints in apprise
936
942
  )
937
943
 
938
- self._start_apprise_client(url)
944
+ @sync_compatible
945
+ async def notify(
946
+ self,
947
+ body: str,
948
+ subject: str | None = None,
949
+ ):
950
+ # Update apprise client with current to_emails before sending
951
+ if hasattr(self, "_apprise_client") and self._apprise_client:
952
+ self._apprise_client.clear()
953
+ self._apprise_client.add(
954
+ servers=self._build_sendgrid_url().get_secret_value()
955
+ )
956
+
957
+ await super().notify(body, subject)
@@ -5,7 +5,6 @@ Routes for interacting with work queue objects.
5
5
  from typing import List, Optional
6
6
  from uuid import UUID
7
7
 
8
- import sqlalchemy as sa
9
8
  from fastapi import (
10
9
  BackgroundTasks,
11
10
  Body,
@@ -15,6 +14,7 @@ from fastapi import (
15
14
  Path,
16
15
  status,
17
16
  )
17
+ from sqlalchemy.exc import IntegrityError
18
18
 
19
19
  import prefect.server.api.dependencies as dependencies
20
20
  import prefect.server.models as models
@@ -54,7 +54,7 @@ async def create_work_queue(
54
54
  model = await models.work_queues.create_work_queue(
55
55
  session=session, work_queue=work_queue
56
56
  )
57
- except sa.exc.IntegrityError:
57
+ except IntegrityError:
58
58
  raise HTTPException(
59
59
  status_code=status.HTTP_409_CONFLICT,
60
60
  detail="A work queue with this name already exists.",
@@ -184,7 +184,7 @@ async def read_work_queue_runs(
184
184
  async def read_work_queues(
185
185
  limit: int = dependencies.LimitBody(),
186
186
  offset: int = Body(0, ge=0),
187
- work_queues: schemas.filters.WorkQueueFilter = None,
187
+ work_queues: Optional[schemas.filters.WorkQueueFilter] = None,
188
188
  db: PrefectDBInterface = Depends(provide_database_interface),
189
189
  ) -> List[schemas.responses.WorkQueueResponse]:
190
190
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prefect-client
3
- Version: 3.4.5.dev2
3
+ Version: 3.4.5.dev3
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=9xE-pLfsiawfK73a0FMF5AUPjrZWfEwTt5OfnGrZbYY,185
4
+ prefect/_build_info.py,sha256=wvC1XkR1XgjsH4Sv-7jUV6-sxAU8PceohzevJIBAZKE,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
@@ -75,7 +75,7 @@ prefect/blocks/__init__.py,sha256=D0hB72qMfgqnBB2EMZRxUxlX9yLfkab5zDChOwJZmkY,22
75
75
  prefect/blocks/abstract.py,sha256=mpOAWopSR_RrzdxeurBTXVSKisP8ne-k8LYos-tp7go,17021
76
76
  prefect/blocks/core.py,sha256=iP-g6guW9HFkt-sFpgH8WCyWhwnH5zIoUJuI2ykImG0,62894
77
77
  prefect/blocks/fields.py,sha256=1m507VVmkpOnMF_7N-qboRjtw4_ceIuDneX3jZ3Jm54,63
78
- prefect/blocks/notifications.py,sha256=UpNNxc4Bwx0nSlDj-vZQOv2XyUCUB2PaO4uBPO1Y6XM,34162
78
+ prefect/blocks/notifications.py,sha256=NEhdnV_Alt_dGSfq8T1q2l0frh8IVvLCfn0YjXBLJdU,34861
79
79
  prefect/blocks/redis.py,sha256=lt_f1SIcS5OVvthCY6KRWiy5DyUZNRlHqkKhKF25P8c,5770
80
80
  prefect/blocks/system.py,sha256=4KiUIy5zizMqfGJrxvi9GLRLcMj4BjAXARxCUEmgbKI,5041
81
81
  prefect/blocks/webhook.py,sha256=xylFigbDOsn-YzxahkTzNqYwrIA7wwS6204P0goLY3A,2907
@@ -227,7 +227,7 @@ prefect/server/api/task_workers.py,sha256=cFP9M8tsApDL_JpySn-x6fOYy9RnOeOgKiqOl_
227
227
  prefect/server/api/templates.py,sha256=92bLFfcahZUp5PVNTZPjl8uJSDj4ZYRTVdmTzZXkERg,1027
228
228
  prefect/server/api/validation.py,sha256=HxSNyH8yb_tI-kOfjXESRjJp6WQK6hYWBJsaBxUvY34,14490
229
229
  prefect/server/api/variables.py,sha256=SJaKuqInfQIEdMlJOemptBDN43KLFhlf_u9QwupDu7A,6185
230
- prefect/server/api/work_queues.py,sha256=wBcbmkZDaQ5Ddi9wc8tNs6kYG_FdNtYwTCR0VkhPj2o,7588
230
+ prefect/server/api/work_queues.py,sha256=368YmggZbDYpD6-p4MXFvDniImEp1Tr4zejvmIA2lXM,7609
231
231
  prefect/server/api/workers.py,sha256=8EVPnGv9wAC3YBWIoUx70OS7zfhRKjoXAAECFWKBMg0,24121
232
232
  prefect/server/api/collections_data/views/aggregate-worker-metadata.json,sha256=f6t13GRkIcLqGYB3OnXluAHEFoSqZM2SQP22vpcu0Mk,79793
233
233
  prefect/server/api/static/prefect-logo-mark-gradient.png,sha256=ylRjJkI_JHCw8VbQasNnXQHwZW-sH-IQiUGSD3aWP1E,73430
@@ -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.5.dev2.dist-info/METADATA,sha256=8WuQo6XipDjXTtieMPY-hjxp4Bq63yKWLwuChMT-qlQ,7472
326
- prefect_client-3.4.5.dev2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
327
- prefect_client-3.4.5.dev2.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
328
- prefect_client-3.4.5.dev2.dist-info/RECORD,,
325
+ prefect_client-3.4.5.dev3.dist-info/METADATA,sha256=Slhh-gv8YTEFMl_5ql0rcq345UE-YJf5EpAQDnWMNZw,7472
326
+ prefect_client-3.4.5.dev3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
327
+ prefect_client-3.4.5.dev3.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
328
+ prefect_client-3.4.5.dev3.dist-info/RECORD,,