prefect 3.7.6.dev1__py3-none-any.whl → 3.7.6.dev2__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.7.6.dev1"
3
- __build_date__ = "2026-06-20 09:11:41.889135+00:00"
4
- __git_commit__ = "441d5e112d263706d963612aabc8f252df94a42e"
2
+ __version__ = "3.7.6.dev2"
3
+ __build_date__ = "2026-06-23 09:17:34.234563+00:00"
4
+ __git_commit__ = "59cc990c54a9d59f889f4f070e89d118fe7fa670"
5
5
  __dirty__ = False
prefect/server/AGENTS.md CHANGED
@@ -63,6 +63,8 @@ alembic_revision("description") # Create a new migration
63
63
 
64
64
  - **`record_bulk_task_run_events` batches must be sorted by conflict key before upserting.** In `services/task_run_recorder.py`, task runs are sorted by conflict key — natural key `(flow_run_id, task_key, dynamic_key)` when available, otherwise `("id", task_run_id)` — before batching into upsert groups. This enforces deterministic row-level lock acquisition order across concurrent recorder instances; removing or reordering the sort causes deadlocks. Events that collide on either `id` or natural key are coalesced via union-find to a single canonical ID — the input `TaskRun.id` and `state.state_details.task_run_id` are mutated in-place to that canonical value. Any refactor that re-batches or re-merges must re-sort by conflict key. The function retries once internally on `IntegrityError` to handle TOCTOU races between concurrent recorders, then re-raises on a second failure — callers must catch `IntegrityError` or re-queue the batch.
65
65
 
66
+ - **`docket.add()` in monitor loops must pass a per-entity `key=` to prevent duplicate enqueues.** Without it, repeated iterations over the same pending entity enqueue duplicate tasks — causing duplicate state transitions. Format: `"<service-name>:<entity-id>"`, e.g., `"mark-flow-run-late:{run.id}"` in `services/late_runs.py`.
67
+
66
68
  ## UI Serving Architecture
67
69
 
68
70
  Both V1 and V2 UI bundles are served simultaneously when available: V1 at `PREFECT_UI_SERVE_BASE` (default `/`), V2 at `{base_url}/v2`. The `redirect_to_preferred_ui` middleware routes neutral entry points using the `prefect_ui_version` cookie. `PREFECT_SERVER_UI_V2_ENABLED` sets the *default* for browsers with no saved preference — it does not remove V1 or force all users to V2. Both bundles must be built before packaging (`PREFECT_REQUIRE_PACKAGED_UI_BUNDLES=1` enforces this via `hatch_build.py`).
@@ -1789,10 +1789,15 @@ class EnsureOnlyScheduledFlowsMarkedLate(FlowRunOrchestrationRule):
1789
1789
  marking_flow_late = (
1790
1790
  proposed_state.is_scheduled() and proposed_state.name == "Late"
1791
1791
  )
1792
- if marking_flow_late and not initial_state.is_scheduled():
1793
- await self.reject_transition(
1794
- state=None, reason="Only scheduled flows can be marked late."
1795
- )
1792
+ if marking_flow_late:
1793
+ if not initial_state.is_scheduled():
1794
+ await self.reject_transition(
1795
+ state=None, reason="Only scheduled flows can be marked late."
1796
+ )
1797
+ elif initial_state.name == "Late":
1798
+ await self.reject_transition(
1799
+ state=None, reason="This flow run is already marked late."
1800
+ )
1796
1801
 
1797
1802
 
1798
1803
  class EnforceDeploymentConcurrencyOnLate(FlowRunOrchestrationRule):
@@ -82,4 +82,6 @@ async def monitor_late_runs(
82
82
  runs = result.all()
83
83
 
84
84
  for run in runs:
85
- await docket.add(mark_flow_run_late)(run.id)
85
+ await docket.add(mark_flow_run_late, key=f"mark-flow-run-late:{run.id}")(
86
+ run.id
87
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prefect
3
- Version: 3.7.6.dev1
3
+ Version: 3.7.6.dev2
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
@@ -2,7 +2,7 @@ prefect/.prefectignore,sha256=awSprvKT0vI8a64mEOLrMxhxqcO-b0ERQeYpA2rNKVQ,390
2
2
  prefect/AGENTS.md,sha256=H7j73ZMACxsIfHXO6pTAdyQy2yi7XGnADtgwcMqMVO4,11049
3
3
  prefect/__init__.py,sha256=Z8rwfLbEOLh-5WcznTZP3FG2-9UgGZxY-prj8sL0-Qk,6828
4
4
  prefect/__main__.py,sha256=WFjw3kaYJY6pOTA7WDOgqjsz8zUEUZHCcj3P5wyVa-g,66
5
- prefect/_build_info.py,sha256=KedvwcJ72g4J4fG_d57YKRiI5DI6aPGYT0VtGuYIMCc,185
5
+ prefect/_build_info.py,sha256=IJUs0aLr6x2ePBdl5nYSUPe7f51s-nCdxNdQihzEn_g,185
6
6
  prefect/_flow_run_suspension.py,sha256=5zTTB7ZIBHzoS0pVrhNn23-9hK51qZ3CQA6C-azluC0,4144
7
7
  prefect/agent.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
8
8
  prefect/artifacts.py,sha256=ZdMLJeJGK82hibtRzbsVa-g95dMa0D2UP1LiESoXmf4,23951
@@ -373,7 +373,7 @@ prefect/runtime/__init__.py,sha256=JswiTlYRup2zXOYu8AqJ7czKtgcw9Kxo0tTbS6aWCqY,4
373
373
  prefect/runtime/deployment.py,sha256=jYD-jkbb1dAl0wQuiY5mulVTqAEnF4xE3D5Iard6yms,5552
374
374
  prefect/runtime/flow_run.py,sha256=KZRWdcqKOHvlK1g4OucFTH_o3XonoI1rzF81uQfjdu0,10793
375
375
  prefect/runtime/task_run.py,sha256=zYBSs7QrAu7c2IjKomRzPXKyIXrjqclMTMrco-dwyOw,4212
376
- prefect/server/AGENTS.md,sha256=tKf-KqlG_LdvlTTEioXj1ZIBoTLe0GM9XcBBcz19Cjg,11215
376
+ prefect/server/AGENTS.md,sha256=irHPO_9gjX-CcP7eGNUoWiCa1W-YsICpHSXvbdzhfiw,11547
377
377
  prefect/server/__init__.py,sha256=kW3pOfJv1zX6OIsTPbIrezVFXJpQJsqISQYmY_8ouKo,611
378
378
  prefect/server/collection_blocks_data.json,sha256=R1Vx6FFjaUr-WzgqVwduDMWQTiDdPBMoLJQRmjyB58I,284238
379
379
  prefect/server/exceptions.py,sha256=zfbfOdF-PsqnRUqxUXJ__zD905XJx1egFBrrUbIfkRA,735
@@ -717,7 +717,7 @@ prefect/server/models/variables.py,sha256=2XZpy__pHWzN5zHviKawVjYDxkveXxYmO0phyR
717
717
  prefect/server/models/work_queues.py,sha256=tGhxonnCWVdxkhXatSYTmazpLpXL3YGiisXysmty8Lg,28562
718
718
  prefect/server/models/workers.py,sha256=J-Ms1nFs_Jm4bPX-6_jWdlofXPnDBmbyf3aQHD6FhtQ,43863
719
719
  prefect/server/orchestration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
720
- prefect/server/orchestration/core_policy.py,sha256=wxTh49Ug3fGAm0EcuBXBzPMest9rqk9dMaQ792TTjzE,79682
720
+ prefect/server/orchestration/core_policy.py,sha256=I-BqVUk9x_-GgynatayRFDh8Jri4TM_B73KdpP8EdaI,79896
721
721
  prefect/server/orchestration/dependencies.py,sha256=zV5zUj699gjgGroMVufTOhI5DuRp2r70hNSnQz8i768,4671
722
722
  prefect/server/orchestration/global_policy.py,sha256=AOGfrZuU7tKwSmRvjzduC-wnnLJiwCOW47kO-h1d5qI,15498
723
723
  prefect/server/orchestration/instrumentation_policies.py,sha256=Qx5fIzsUyc2cGY00FXksM7o7WRYvjp2daJcPEExDt9M,2416
@@ -741,7 +741,7 @@ prefect/server/services/cancellation_cleanup.py,sha256=6GV3IMT5sbS4kbgYQ3E44kKnC
741
741
  prefect/server/services/cleanup_reconciler.py,sha256=G5xjJb3RHEDbYlnrNDX1kTXaNg_oU8WvVm-oZFB8oWc,2100
742
742
  prefect/server/services/db_vacuum.py,sha256=vUSUXdKi4I4MmZIDR9RiyDv1AGR5Uf5cbYk63qW8qvs,16312
743
743
  prefect/server/services/foreman.py,sha256=ZRmFG7UcNa7aFgqov680hefbvufzQ8mA2HyHCCvVXnw,7999
744
- prefect/server/services/late_runs.py,sha256=4LqsrjY6AjRz5NbLyoOdSpVvEL3JKJWVYX0LVRu2mOs,3065
744
+ prefect/server/services/late_runs.py,sha256=zkdZLN3b4UPmZXXr8h2qe1QAMjTXGtWEr1tQtPvzS-8,3131
745
745
  prefect/server/services/pause_expirations.py,sha256=qa-Mob_CTEoaQz8KKpoT6lpwPDdXp8H8nAoBr_cdLYc,2914
746
746
  prefect/server/services/perpetual_services.py,sha256=HA8WVTsWxKYgWqSOBw4pSD_UWj460Ssfrgnh0AvN8Us,5234
747
747
  prefect/server/services/repossessor.py,sha256=Dt94fZTQeVzNBLYV7_Yf9AfWMwflpFqhN6lFeGLCIRQ,2839
@@ -1387,8 +1387,8 @@ prefect/workers/_worker_channel/_protocol.py,sha256=GpCNh1o3qmmqHA_UOOTge1QVC6IR
1387
1387
  prefect/workers/_worker_channel/_state.py,sha256=eQTFZtAVDZH1vVWps3SdeY6aW3qu2wx1UKYQXK3AyuE,5369
1388
1388
  prefect/workers/_worker_channel/_sync.py,sha256=G5G8_UaQYbeLebi5Mb1Z_KgGfXfyjXo5uT9la5_zwqY,14984
1389
1389
  prefect/workers/_worker_channel/_transport.py,sha256=_8aWX16tdbZcpqBg4HCX_vCzl2FX47jsYPKMPLAANRA,9181
1390
- prefect-3.7.6.dev1.dist-info/METADATA,sha256=d-KyfXhKts7Vrthoz17riuDODN5YobQS2fNaqykmemw,14030
1391
- prefect-3.7.6.dev1.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
1392
- prefect-3.7.6.dev1.dist-info/entry_points.txt,sha256=HlY8up83iIq2vU2r33a0qSis4eOFSyb1mRH4l7Xt9X8,126
1393
- prefect-3.7.6.dev1.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
1394
- prefect-3.7.6.dev1.dist-info/RECORD,,
1390
+ prefect-3.7.6.dev2.dist-info/METADATA,sha256=KXTK-vXSaI0hwpRh7AB4n3GDarsSfN0ZP3Qv6aVWWwo,14030
1391
+ prefect-3.7.6.dev2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
1392
+ prefect-3.7.6.dev2.dist-info/entry_points.txt,sha256=HlY8up83iIq2vU2r33a0qSis4eOFSyb1mRH4l7Xt9X8,126
1393
+ prefect-3.7.6.dev2.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
1394
+ prefect-3.7.6.dev2.dist-info/RECORD,,