hatchet-sdk 1.11.1__py3-none-any.whl → 1.12.1__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.

Potentially problematic release.


This version of hatchet-sdk might be problematic. Click here for more details.

Files changed (31) hide show
  1. hatchet_sdk/__init__.py +2 -0
  2. hatchet_sdk/client.py +2 -0
  3. hatchet_sdk/clients/events.py +42 -3
  4. hatchet_sdk/clients/rest/__init__.py +5 -0
  5. hatchet_sdk/clients/rest/api/event_api.py +490 -0
  6. hatchet_sdk/clients/rest/api/filter_api.py +339 -0
  7. hatchet_sdk/clients/rest/api/tenant_api.py +275 -0
  8. hatchet_sdk/clients/rest/api/workflow_runs_api.py +310 -0
  9. hatchet_sdk/clients/rest/models/__init__.py +5 -0
  10. hatchet_sdk/clients/rest/models/create_tenant_request.py +22 -2
  11. hatchet_sdk/clients/rest/models/tenant.py +6 -0
  12. hatchet_sdk/clients/rest/models/tenant_ui_version.py +37 -0
  13. hatchet_sdk/clients/rest/models/update_tenant_request.py +6 -0
  14. hatchet_sdk/clients/rest/models/v1_event.py +42 -0
  15. hatchet_sdk/clients/rest/models/v1_event_triggered_run.py +94 -0
  16. hatchet_sdk/clients/rest/models/v1_update_filter_request.py +98 -0
  17. hatchet_sdk/contracts/v1/workflows_pb2.py +26 -24
  18. hatchet_sdk/contracts/v1/workflows_pb2.pyi +14 -2
  19. hatchet_sdk/features/filters.py +36 -0
  20. hatchet_sdk/features/runs.py +22 -3
  21. hatchet_sdk/features/tenant.py +32 -0
  22. hatchet_sdk/hatchet.py +51 -8
  23. hatchet_sdk/runnables/action.py +1 -1
  24. hatchet_sdk/runnables/types.py +22 -4
  25. hatchet_sdk/runnables/workflow.py +413 -188
  26. hatchet_sdk/waits.py +2 -2
  27. {hatchet_sdk-1.11.1.dist-info → hatchet_sdk-1.12.1.dist-info}/METADATA +1 -1
  28. {hatchet_sdk-1.11.1.dist-info → hatchet_sdk-1.12.1.dist-info}/RECORD +30 -27
  29. hatchet_sdk/runnables/standalone.py +0 -391
  30. {hatchet_sdk-1.11.1.dist-info → hatchet_sdk-1.12.1.dist-info}/WHEEL +0 -0
  31. {hatchet_sdk-1.11.1.dist-info → hatchet_sdk-1.12.1.dist-info}/entry_points.txt +0 -0
hatchet_sdk/waits.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from abc import ABC, abstractmethod
2
- from datetime import datetime
2
+ from datetime import datetime, timezone
3
3
  from enum import Enum
4
4
  from typing import TYPE_CHECKING
5
5
  from uuid import uuid4
@@ -116,7 +116,7 @@ class ParentCondition(Condition):
116
116
  parent.name
117
117
  + (f":{expression}" if expression else "")
118
118
  + ":"
119
- + datetime.now().isoformat()
119
+ + datetime.now(tz=timezone.utc).isoformat()
120
120
  ),
121
121
  expression=expression,
122
122
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hatchet-sdk
3
- Version: 1.11.1
3
+ Version: 1.12.1
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Alexander Belanger
@@ -1,20 +1,20 @@
1
- hatchet_sdk/__init__.py,sha256=TW5T_It9W79Lfu-QaxMYBXMjYaXQdOpOS6bvYJm6VjQ,10198
2
- hatchet_sdk/client.py,sha256=7ONBiE29OKQci3Qaz7U5e-WSxO_ohnWq8F-MSgzG2fU,2312
1
+ hatchet_sdk/__init__.py,sha256=si6xDsRLQ6UgaOD1_1fLpUcPhVIGZMKK-AmDJwnI6Hg,10238
2
+ hatchet_sdk/client.py,sha256=OXb2hOJ5p7pY5QMlM4cydb4aGyf6bDdbyWQjPMVCe64,2413
3
3
  hatchet_sdk/clients/admin.py,sha256=B4fav9EYdsMbMqaH3GUEwL8sza1tQ3RORlwGXUb7qp0,17019
4
4
  hatchet_sdk/clients/dispatcher/action_listener.py,sha256=XUDXye-HW4V30DBgjd_dmq7e03AS9eBxUJi1VsvfSqE,13837
5
5
  hatchet_sdk/clients/dispatcher/dispatcher.py,sha256=LoxQEX5FS6v-qKRtOXoqsx3VlBUgFgTkbK58LU1eU3I,8176
6
6
  hatchet_sdk/clients/event_ts.py,sha256=MudFszIb9IcPKQYvBTzcatPkcWEy3nxbAtEQ0_NYxMg,2094
7
- hatchet_sdk/clients/events.py,sha256=6nfZogeEgXC0Tzq6RDCTVPcBvLBVBlEonlTo-ticfrc,7200
7
+ hatchet_sdk/clients/events.py,sha256=gqxNZphGFkIzMKyvmLWaaWmFglXR95ZiQxkS_F1rXTY,8740
8
8
  hatchet_sdk/clients/listeners/durable_event_listener.py,sha256=jpqnbZsuouWk3XaOIYL9apaGtVk65eKKq66eBP9klBs,4085
9
9
  hatchet_sdk/clients/listeners/pooled_listener.py,sha256=1rodfIeqmHRF-u-PB6cBJbOU8NrvToLTyGigJMydpGo,8496
10
10
  hatchet_sdk/clients/listeners/run_event_listener.py,sha256=rIjBLRF7d7FBoEq7RKbmbOA84lX_hHSU26trwnthqV8,10230
11
11
  hatchet_sdk/clients/listeners/workflow_listener.py,sha256=EhBZZnHiidDLvAc4r54Re_LJXVypinbgTE9qKBybxj8,2054
12
- hatchet_sdk/clients/rest/__init__.py,sha256=V9i3t1gvTe_g4Y4mDkeO1WYcdwPE3entvWncu2_PNWg,17201
12
+ hatchet_sdk/clients/rest/__init__.py,sha256=0bOD0KcR1mN8ZxEQuVBLJacaFehKKWGMinLeiVCi8dU,17466
13
13
  hatchet_sdk/clients/rest/api/__init__.py,sha256=Hha-Kw2hqeGf7j96pNzl3YlkHaD7HnEWGZCqvr18Vbk,1262
14
14
  hatchet_sdk/clients/rest/api/api_token_api.py,sha256=xzqMH_-wajBA0qLLs5Ta7tYg4FOLq0NjATyhZ1SV9jo,33433
15
15
  hatchet_sdk/clients/rest/api/default_api.py,sha256=Y0jEhatVpdIX_W2MCt_n40K6iKvVegDB70qxexkeZDI,88677
16
- hatchet_sdk/clients/rest/api/event_api.py,sha256=LUTs0DM_jnv7LszOMm6bdsdkGdLuIoRo-foLe8aYKSA,112380
17
- hatchet_sdk/clients/rest/api/filter_api.py,sha256=m33n5ylRTPoFBuNXWGeabm98Te0C5mzJ_CcCOG6wxQc,49775
16
+ hatchet_sdk/clients/rest/api/event_api.py,sha256=R7OsLTAodCpHX8ynX0zxJqr5gB19nlmlohK-jeZPDu8,132097
17
+ hatchet_sdk/clients/rest/api/filter_api.py,sha256=JernNvf6tqv35p85bkgxIxpIkuY8y668XyZONoEQ8oU,62955
18
18
  hatchet_sdk/clients/rest/api/github_api.py,sha256=yoCCZ33r5rQYp9b2pp36TGzjq-zORSYX1LMp5Ibsll8,12059
19
19
  hatchet_sdk/clients/rest/api/healthcheck_api.py,sha256=fr8DOMqCMe4igJFeyi0C2ZmAMlghJszAl2SQJMnUzKc,18683
20
20
  hatchet_sdk/clients/rest/api/log_api.py,sha256=YaXZS69ZLin2KbWuUl_BAm6rd6wdfKAaOAEGqhLd_Bw,27048
@@ -24,17 +24,17 @@ hatchet_sdk/clients/rest/api/slack_api.py,sha256=0xIUw3_1_3hSTn2yw7fLRO5yb38nYLu
24
24
  hatchet_sdk/clients/rest/api/sns_api.py,sha256=1LfhnZEA450uHwtZCoM_wycOeH4UGwfNP1pw4RWSe08,33641
25
25
  hatchet_sdk/clients/rest/api/step_run_api.py,sha256=rqP4UIJSkw8DwbDnlEgupBDWUL0jlVH_Rm7bNGMUoG8,84505
26
26
  hatchet_sdk/clients/rest/api/task_api.py,sha256=erYaoDA2iJk52PPntfT0Y63hsBuk4eaqV5gaRTQ008w,89767
27
- hatchet_sdk/clients/rest/api/tenant_api.py,sha256=LYUdJSsg-O-Y_7cuCDdtDHP5P0BQ9ch8RFLQKIiIreQ,177493
27
+ hatchet_sdk/clients/rest/api/tenant_api.py,sha256=DO1a6YXpb4_kUO3HAYTHbHL_khFe7i1SLb6q7EoGxUc,187997
28
28
  hatchet_sdk/clients/rest/api/user_api.py,sha256=NYuEKLeBjXO4q8gyYq1thtbuRm9m3g0R6-q6LIfv83U,115780
29
29
  hatchet_sdk/clients/rest/api/worker_api.py,sha256=56jRXsyK7SDENly2b019EO80d8xOHU4bZnmOmjKY1iQ,33049
30
30
  hatchet_sdk/clients/rest/api/workflow_api.py,sha256=rpPXy5xZDZWo1GXQGLapTC3A5M_spk1zoK_vu_J7SVA,251652
31
31
  hatchet_sdk/clients/rest/api/workflow_run_api.py,sha256=Jvge80z6DhlqL9OuLzUC49OtojeiCuagrMbNBThMYI4,78120
32
- hatchet_sdk/clients/rest/api/workflow_runs_api.py,sha256=v8kds3wwTurxrzB-ulkMbTGZMbpc26s8rCV3jGZz8Xg,83732
32
+ hatchet_sdk/clients/rest/api/workflow_runs_api.py,sha256=PwUCdfseQvB6amGYW1XmowmrQaZaQODZaDebBXjAkPQ,96418
33
33
  hatchet_sdk/clients/rest/api_client.py,sha256=25vNKzpKVhvrGrU8T2YBLbz0Y7K0pKZwiLXF3Oc7tt0,27435
34
34
  hatchet_sdk/clients/rest/api_response.py,sha256=rSuCVGY-HE8X_WwteQP5wyANIuS-L5AmtZEUOwTicak,641
35
35
  hatchet_sdk/clients/rest/configuration.py,sha256=ijGxGorVe8OEikJruwJ0hPk1Rc0OAKOqeUrfcoEiYH8,19333
36
36
  hatchet_sdk/clients/rest/exceptions.py,sha256=5PTEjyGxLeGP8U_qqc79QzR-sN7SOhzBwknSUC-BU4c,6365
37
- hatchet_sdk/clients/rest/models/__init__.py,sha256=CfYnIFJQuU40eNS3zQJ4NvG01PXdshNV-NjxsHPrRzA,15559
37
+ hatchet_sdk/clients/rest/models/__init__.py,sha256=rKvfyD9B8tVISjMUxX-P2_wYOXGDdBdid5Af3-4x7h0,15824
38
38
  hatchet_sdk/clients/rest/models/accept_invite_request.py,sha256=_otOis3SuTHl0F_hhYD-rYqgyxCXRn83CK_eU9oMdn4,2427
39
39
  hatchet_sdk/clients/rest/models/api_error.py,sha256=KodK1_cc28CgYGvX1WhIhTN0pAAkgq8PJXReIrMnqBA,3068
40
40
  hatchet_sdk/clients/rest/models/api_errors.py,sha256=RNmnWn1GWlG9xTvpvrTmKq-Pr70x9mcJ4-dNFBemxa8,2917
@@ -57,7 +57,7 @@ hatchet_sdk/clients/rest/models/create_pull_request_from_step_run.py,sha256=YWYB
57
57
  hatchet_sdk/clients/rest/models/create_sns_integration_request.py,sha256=8xi59Xun0UGlNxJ7VuqHPAfqqH4takdtmZ673mK_6Og,2517
58
58
  hatchet_sdk/clients/rest/models/create_tenant_alert_email_group_request.py,sha256=MgMDiPtElEiiZU6boYVkOl9nSkvP9bnFjUIzByEn7WM,2488
59
59
  hatchet_sdk/clients/rest/models/create_tenant_invite_request.py,sha256=fVCrUaEcnKW8ekH4mPZpch1056i4tJVYHRyU9aDVuVE,2648
60
- hatchet_sdk/clients/rest/models/create_tenant_request.py,sha256=zgYoNY6GSRbnx-EqBN903ry_XNyhdj87b7YMrAbkIFk,2511
60
+ hatchet_sdk/clients/rest/models/create_tenant_request.py,sha256=ZKDe4BNp5DqVTlc10Ud10BaIwUcGay0i2sPl6W4Iv9Y,3232
61
61
  hatchet_sdk/clients/rest/models/cron_workflows.py,sha256=mHYhFHC-0NcA_sosCnYCqRiTYMvSbQQZiRCMTO4kgYc,4310
62
62
  hatchet_sdk/clients/rest/models/cron_workflows_list.py,sha256=bLMycEajkleH0-8gGuqDAvZDparvQ4LRKa2sX3bxsG0,3495
63
63
  hatchet_sdk/clients/rest/models/cron_workflows_method.py,sha256=zq05HHTwhf-D2kmhbf40ihYCDBihAeEMQEbr7DrtaoM,679
@@ -123,7 +123,7 @@ hatchet_sdk/clients/rest/models/step_run_event_list.py,sha256=-Mg1FVd__JuS8YAiWq
123
123
  hatchet_sdk/clients/rest/models/step_run_event_reason.py,sha256=mFPJ_9Ocb8lwmEGzxK-iYhrdmTm8_46RknP88HuvFRs,1286
124
124
  hatchet_sdk/clients/rest/models/step_run_event_severity.py,sha256=w4wwMnpesHEyPgsuGK0SMOW-86fPcnYqdHNZLnV2k9A,710
125
125
  hatchet_sdk/clients/rest/models/step_run_status.py,sha256=MTp9av3uPCqDMoBXq5JuP7pU_TgTTNNS4qh50Mrm3G8,873
126
- hatchet_sdk/clients/rest/models/tenant.py,sha256=FMUxFjwu8lRycixFRN3f38gqSN1PBnguHojq5HKVB0s,3818
126
+ hatchet_sdk/clients/rest/models/tenant.py,sha256=NIaxcdsqC_4x9tbSUuMcIsgDTJj8zYRLBooJ3h-7HpU,4102
127
127
  hatchet_sdk/clients/rest/models/tenant_alert_email_group.py,sha256=QOipFLcB7yqMsesEElJAzOVrZ1_7B6TAhuNgsFwAxGg,2976
128
128
  hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py,sha256=rEmYCyWVree4mez0bTjD-S4dvcbi97c72qE3q9bFDgI,3570
129
129
  hatchet_sdk/clients/rest/models/tenant_alerting_settings.py,sha256=fOK_v5ZJ00Cypagv7lTplmvOmkLTUQgGnsBwtpLVN1o,4820
@@ -138,11 +138,12 @@ hatchet_sdk/clients/rest/models/tenant_resource.py,sha256=oQX7-Ekg_NAOHWgs59kmxf
138
138
  hatchet_sdk/clients/rest/models/tenant_resource_limit.py,sha256=iVkEliSDbLcdi1EYdh9jfA66Ft1bhCcrIQ2ZC9JgGe8,4236
139
139
  hatchet_sdk/clients/rest/models/tenant_resource_policy.py,sha256=laL2UxMLkn3CPULnK3og2tLxoLaCvdcqDYi4er9cAQo,3092
140
140
  hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py,sha256=pkbuRSwrKS2XDUC-7k6wsyiKWlK9ALUPU1Ys-ENgapk,2400
141
+ hatchet_sdk/clients/rest/models/tenant_ui_version.py,sha256=iZSSY_cOHmwmKY5U6oZLFXtMhrZvBHpaO5vH2LOt48U,655
141
142
  hatchet_sdk/clients/rest/models/tenant_version.py,sha256=5izyls2uBLE-gHEPfBaRaWOE24k9iM-2T_TB_LYINJ8,649
142
143
  hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py,sha256=8l1biY4plhSQFr8w6g4a_pcZjJSBuPO18WjCr4Dz75k,2644
143
144
  hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py,sha256=9KfQNVApba-LG49ioR-W16YAfk2W2HanV_RRDugQeho,2488
144
145
  hatchet_sdk/clients/rest/models/update_tenant_invite_request.py,sha256=RSoI2hpSMJsgQiDt8NfJggOYJmdUfjFeHUxEWK0gPhk,2524
145
- hatchet_sdk/clients/rest/models/update_tenant_request.py,sha256=C4R0O1bHSZJqA4Z6FwutIOxaQ2qJ2e-peB3wEIwZijw,4767
146
+ hatchet_sdk/clients/rest/models/update_tenant_request.py,sha256=CWLIeBE9XPR8Ydk8yEcUlSMmju7g-H94OUDjkO_VL14,5051
146
147
  hatchet_sdk/clients/rest/models/update_worker_request.py,sha256=7UkXgkwTfXKirY1iuFa-Yqzk3lC-3CNByYRGo65l9U8,2536
147
148
  hatchet_sdk/clients/rest/models/user.py,sha256=D0royyHH9yFSJk7RinRUNdU8xB3Vo-QiOohIznyBHBg,3845
148
149
  hatchet_sdk/clients/rest/models/user_change_password_request.py,sha256=wphigE47qpJrmy3x-Ve7r44Nw7yD42Dcdbd1FIwcRKM,2646
@@ -153,8 +154,9 @@ hatchet_sdk/clients/rest/models/user_tenant_public.py,sha256=-P2vPanI-paZmj_0nm7
153
154
  hatchet_sdk/clients/rest/models/v1_cancel_task_request.py,sha256=U0QKLQ7E35sgGSZyi-n3C9omZneqHVBMYymfD5a189g,3178
154
155
  hatchet_sdk/clients/rest/models/v1_create_filter_request.py,sha256=2OCv0o9bhgIF20L-KOXTvePbVI_G6eXTunGTNHMYEwg,3117
155
156
  hatchet_sdk/clients/rest/models/v1_dag_children.py,sha256=Rk_mKqboHebga12JhnQbN3yhrLXKm_hqtCbTfAdJliU,3135
156
- hatchet_sdk/clients/rest/models/v1_event.py,sha256=S5VkTg-o2v8ACJi_u6n4rO53K_wR7uiMutLsKv1KWB8,4695
157
+ hatchet_sdk/clients/rest/models/v1_event.py,sha256=OvHE2pSuJZEtIRvV7y1kIL1M63_qz6UGsPCjT5Qz9Fk,6408
157
158
  hatchet_sdk/clients/rest/models/v1_event_list.py,sha256=miUX2fVgV_9dFHm6Kx3A09KSI8fRowbEwtfzImuTHfE,3447
159
+ hatchet_sdk/clients/rest/models/v1_event_triggered_run.py,sha256=JBi9i3_XBosPqG95yjL92YdNVc-Yxa92JRaIrhxkEcU,2828
158
160
  hatchet_sdk/clients/rest/models/v1_event_workflow_run_summary.py,sha256=X09QH2HU7a7TV4A7xH6P5LxekWlWR_NOsPv9-E3Ncy8,3089
159
161
  hatchet_sdk/clients/rest/models/v1_filter.py,sha256=XKP8VAKRt3Ks1dZmo0ggtba5zTjIMWXkZuMSwZhDOLI,3899
160
162
  hatchet_sdk/clients/rest/models/v1_filter_list.py,sha256=TFeTo77aAs-3yeCdgCWHn2NRgflP1vpxd1XiylnGp5E,3455
@@ -177,6 +179,7 @@ hatchet_sdk/clients/rest/models/v1_task_summary_list.py,sha256=0m-xf_lY9BwwbLky9
177
179
  hatchet_sdk/clients/rest/models/v1_task_timing.py,sha256=ygr-r0_Mius0JDSAYIYjsXOvBByG5nxlJ0-cXOoCq7g,5969
178
180
  hatchet_sdk/clients/rest/models/v1_task_timing_list.py,sha256=1LFoKqFn11EJ_t7ZeWUFldWOWfG09tN_wTZu3a8e_SM,3509
179
181
  hatchet_sdk/clients/rest/models/v1_trigger_workflow_run_request.py,sha256=P-dC3O7dPr6mGJ2UZYcl3lSQoxKcX-GlYOiWkmNRMj0,3080
182
+ hatchet_sdk/clients/rest/models/v1_update_filter_request.py,sha256=XSWSkNlYZTcVdnZSGFSDVn8g_9YjlXW2UYQSeCiU2No,2953
180
183
  hatchet_sdk/clients/rest/models/v1_workflow_run.py,sha256=0kgHJ35XjXgNfaJfb1p0KLS1Jw6VAMeMYSdts8EvuYc,5895
181
184
  hatchet_sdk/clients/rest/models/v1_workflow_run_details.py,sha256=vMnc50mT-tjfFlg2BJ58s2HhFvqvuGJaPGYAlTrLVI4,5040
182
185
  hatchet_sdk/clients/rest/models/v1_workflow_run_display_name.py,sha256=0r6ASZvs6zUzW-YcJGbhkV_cs6N7jl-5l7f_LLgvBVY,2982
@@ -244,35 +247,35 @@ hatchet_sdk/contracts/v1/dispatcher_pb2_grpc.py,sha256=alnJTOJmf9AWr5qvqX0ivqEm1
244
247
  hatchet_sdk/contracts/v1/shared/condition_pb2.py,sha256=dLBp9p48xEgDIOUU3lWn9wb5HWlQShaMp-1-_OAbKZY,3194
245
248
  hatchet_sdk/contracts/v1/shared/condition_pb2.pyi,sha256=OZrUydy3wmHIoZjUQ5wrVTEaayTQlIZhfwJ8KyS26t8,3873
246
249
  hatchet_sdk/contracts/v1/shared/condition_pb2_grpc.py,sha256=-LQAfCTGRcj81g8ij2CUeuBDNKHTO3JojkByh3ay0QY,1136
247
- hatchet_sdk/contracts/v1/workflows_pb2.py,sha256=5D0OjZP58jlkDh1qr74JBFfx94tBSOmXOxfXJXz9y3E,9162
248
- hatchet_sdk/contracts/v1/workflows_pb2.pyi,sha256=UQv-jSQoYR63ru4Ufu9MzF-X4gzoSPa1faYcnT6FdWA,12043
250
+ hatchet_sdk/contracts/v1/workflows_pb2.py,sha256=Ro3UdgZETnM7vhnK5gbwjeW-pEKHjTXWu3m1455SY0E,9508
251
+ hatchet_sdk/contracts/v1/workflows_pb2.pyi,sha256=BBGTXhzcYg2cuzuqhk2Aps7k-L_CIQ2oGNkyVURh-nE,12666
249
252
  hatchet_sdk/contracts/v1/workflows_pb2_grpc.py,sha256=XytYpV2kJQZT8iAs14z4SWsv-90ApfoFUEc8bRb5WHk,9299
250
253
  hatchet_sdk/contracts/workflows_pb2.py,sha256=daEsUwZnlDQ5GGLJ8WHgLdI1Tgr3lBXxGV1mJ6go0nE,11812
251
254
  hatchet_sdk/contracts/workflows_pb2.pyi,sha256=WJ3b45pWvoNmmWTWjBJt61IiAoVn61F62AG5OrRsnd8,15538
252
255
  hatchet_sdk/contracts/workflows_pb2_grpc.py,sha256=2V8E72DlJx5qlH2yiQpVCu5cQbKUba5X7T1yNrQDF_s,10819
253
256
  hatchet_sdk/exceptions.py,sha256=HGmYSZy3bCY2rBDEOQfhYGRa7_j9GvYT9Pc0B8Ic5Ug,49
254
257
  hatchet_sdk/features/cron.py,sha256=A2PJts0sGwCgb8ioIOq07qVLt4ASU9s6d2h3RjwVqys,9702
255
- hatchet_sdk/features/filters.py,sha256=3n-3CBIKWc9ruJb5qH6bBmXC_j8i9bMs0b-xnmLL9Qw,5698
258
+ hatchet_sdk/features/filters.py,sha256=xTQf-1arYwTwcEgG-hq0sz60IX1Jn0EGxNtXzT3rAzQ,6770
256
259
  hatchet_sdk/features/logs.py,sha256=OcmgtmNyqFJI03_5ncuSy6M-Ho7AVTa8hnO0CDE3wi4,1172
257
260
  hatchet_sdk/features/metrics.py,sha256=TzAEB4Ogmgcq-EB7lEWQ9V8y-15d23ZuhAgPH6It92Y,4519
258
261
  hatchet_sdk/features/rate_limits.py,sha256=eh55Z3w75cYUthqTyoWmNxj_6tN3rjebMKm3of-vxv0,2155
259
- hatchet_sdk/features/runs.py,sha256=BsPDIglsStfMxNp6hSKsHyUU-CBQHP1O3Mnj9poMYTY,15331
262
+ hatchet_sdk/features/runs.py,sha256=2CN1yKoT_ABGeKSN4Yut1FrcDK_LXr1uGgjSN35IMV0,16114
260
263
  hatchet_sdk/features/scheduled.py,sha256=Uzmex-taGWVIgnUw8QWOy1GX9fb9SWvAaaPMhU6R40c,8964
264
+ hatchet_sdk/features/tenant.py,sha256=vU6buEKVPCydpgrHFsQ_gbKgO5lRmlZG2ypsT7-O4S8,868
261
265
  hatchet_sdk/features/workers.py,sha256=vD6j7GCttu0fm23_XmBMdE0IuX4mUbL0adgMoC8Sk_E,2571
262
266
  hatchet_sdk/features/workflows.py,sha256=15MSYNIjlN1Ilk8sHq_DjLS7XuqlvcAMFuAdFLdjPGY,4012
263
- hatchet_sdk/hatchet.py,sha256=BVWSrKL6GCzarTNAte_r0iWsaBXntxNzrR-syR6qENI,22885
267
+ hatchet_sdk/hatchet.py,sha256=rqjL_Jfmd5n1niT1ZlwovTRA2jmF3PFb2JiLdA8D-c4,25304
264
268
  hatchet_sdk/labels.py,sha256=nATgxWE3lFxRTnfISEpoIRLGbMfAZsHF4lZTuG4Mfic,182
265
269
  hatchet_sdk/logger.py,sha256=5uOr52T4mImSQm1QvWT8HvZFK5WfPNh3Y1cBQZRFgUQ,333
266
270
  hatchet_sdk/metadata.py,sha256=XkRbhnghJJGCdVvF-uzyGBcNaTqpeQ3uiQvNNP1wyBc,107
267
271
  hatchet_sdk/opentelemetry/instrumentor.py,sha256=1hbZsvbK_GiuzkL88P97G6lg0BRPCvyeR7ltfQT32DM,27099
268
272
  hatchet_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
269
273
  hatchet_sdk/rate_limit.py,sha256=TwbCuggiZaWpYuo4mjVLlE-z1OfQ2mRBiVvCSaG3lv4,3919
270
- hatchet_sdk/runnables/action.py,sha256=-CJ1b0SnLdXvWH9HZhhoAmKO68WJRGRn7Y7vcLNr1NU,4396
274
+ hatchet_sdk/runnables/action.py,sha256=3B4VpiWIExiWE6kZBKP8EXXpRbkHrHt-L6hC6w8FZRo,4402
271
275
  hatchet_sdk/runnables/contextvars.py,sha256=3hXlW03FNg2sEq8_A7wMPf_c7FTNuZqg5U9n2S2_hgg,580
272
- hatchet_sdk/runnables/standalone.py,sha256=5MKyLIScJbTHc6N3lRJc6L2Y_9SZj_dQWLV9oA46kqk,15663
273
276
  hatchet_sdk/runnables/task.py,sha256=AOpULMr3hqxn4W58Lh9oEvsXn_7PPB_c_sIqHRfQn5Q,7063
274
- hatchet_sdk/runnables/types.py,sha256=5jf1c7_0QVUFh0bcXi4hIiaOdUiyhspU4LltoAFCwlM,3776
275
- hatchet_sdk/runnables/workflow.py,sha256=lgN2z9or8E4jgHf6C31Kf1KsTa8_rEtE0AwIqGpNEH8,39926
277
+ hatchet_sdk/runnables/types.py,sha256=90JLuwEgRnPlaxS84DCpxjtPzIsN2KLtYQvFvoV_ZIU,4344
278
+ hatchet_sdk/runnables/workflow.py,sha256=itJjwocsUMak_-b_pG3GGfTN3i57VWdKdrFyePyLsaU,48514
276
279
  hatchet_sdk/token.py,sha256=KjIiInwG5Kqd_FO4BSW1x_5Uc7PFbnzIVJqr50-ZldE,779
277
280
  hatchet_sdk/utils/backoff.py,sha256=6B5Rb5nLKw_TqqgpJMYjIBV1PTTtbOMRZCveisVhg_I,353
278
281
  hatchet_sdk/utils/opentelemetry.py,sha256=64TVwCLrUzEmcL2BUNPV_QubfiR5jajOZtVeGYLnEEA,1226
@@ -510,7 +513,7 @@ hatchet_sdk/v0/worker/runner/utils/error_with_traceback.py,sha256=Iih_s8JNqrinXE
510
513
  hatchet_sdk/v0/worker/worker.py,sha256=0yU0z-0si7NzG0U9et9J0tiwfVBSHl4QSiOW-WNmTQM,13027
511
514
  hatchet_sdk/v0/workflow.py,sha256=d4o425efk7J3JgLIge34MW_A3pzwnwSRtwEOgIqM2pc,9387
512
515
  hatchet_sdk/v0/workflow_run.py,sha256=jsEZprXshrSV7i_TtL5uoCL03D18zQ3NeJCq7mp97Dg,1752
513
- hatchet_sdk/waits.py,sha256=L2xZUcmrQX-pTVXWv1W8suMoYU_eA0uowpollauQmOM,3893
516
+ hatchet_sdk/waits.py,sha256=Jh7ogb3U7a8ZKAR1dxpNX9MX4FreKAIg9P-8bl8LZHM,3918
514
517
  hatchet_sdk/worker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
515
518
  hatchet_sdk/worker/action_listener_process.py,sha256=vGtiCqsHf82nU1_2NqgXPY2ZIwFqWcuZeeTkYG3rRTs,11977
516
519
  hatchet_sdk/worker/runner/run_loop_manager.py,sha256=E3KD1r0-BBKUWlZJMDo9e2HHl4uAyvL8gX42-JCRLLc,3794
@@ -518,7 +521,7 @@ hatchet_sdk/worker/runner/runner.py,sha256=9Z3Ac6hRh5rjet7-BRtpcFARlhWvy6TNrdsdj
518
521
  hatchet_sdk/worker/runner/utils/capture_logs.py,sha256=nHRPSiDBqzhObM7i2X7t03OupVFnE7kQBdR2Ckgg-2w,2709
519
522
  hatchet_sdk/worker/worker.py,sha256=SAucu3dg8lkKLbzb3noNWvClZ09lC5tuRcBkYZtIJ-0,16088
520
523
  hatchet_sdk/workflow_run.py,sha256=ZwH0HLFGFVXz6jbiqSv4w0Om2XuR52Tzzw6LH4y65jQ,2765
521
- hatchet_sdk-1.11.1.dist-info/METADATA,sha256=Fd4BDU2OhReYHqLfbSGLFelTHGTfKbQQeksWS0qhqUM,3636
522
- hatchet_sdk-1.11.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
523
- hatchet_sdk-1.11.1.dist-info/entry_points.txt,sha256=Un_76pcLse-ZGBlwebhQpnTPyQrripeHW8J7qmEpGOk,1400
524
- hatchet_sdk-1.11.1.dist-info/RECORD,,
524
+ hatchet_sdk-1.12.1.dist-info/METADATA,sha256=LX6iYo3SfSNoTbSxjPLdTI8D2ygaNakRRLD_gcD1k58,3636
525
+ hatchet_sdk-1.12.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
526
+ hatchet_sdk-1.12.1.dist-info/entry_points.txt,sha256=Un_76pcLse-ZGBlwebhQpnTPyQrripeHW8J7qmEpGOk,1400
527
+ hatchet_sdk-1.12.1.dist-info/RECORD,,
@@ -1,391 +0,0 @@
1
- import asyncio
2
- from datetime import datetime, timedelta
3
- from typing import Any, Generic, cast, get_type_hints
4
-
5
- from hatchet_sdk.clients.admin import (
6
- ScheduleTriggerWorkflowOptions,
7
- TriggerWorkflowOptions,
8
- WorkflowRunTriggerConfig,
9
- )
10
- from hatchet_sdk.clients.rest.models.cron_workflows import CronWorkflows
11
- from hatchet_sdk.clients.rest.models.v1_task_status import V1TaskStatus
12
- from hatchet_sdk.clients.rest.models.v1_task_summary import V1TaskSummary
13
- from hatchet_sdk.contracts.workflows_pb2 import WorkflowVersion
14
- from hatchet_sdk.logger import logger
15
- from hatchet_sdk.runnables.task import Task
16
- from hatchet_sdk.runnables.types import EmptyModel, R, TWorkflowInput
17
- from hatchet_sdk.runnables.workflow import BaseWorkflow, Workflow
18
- from hatchet_sdk.utils.typing import JSONSerializableMapping, is_basemodel_subclass
19
- from hatchet_sdk.workflow_run import WorkflowRunRef
20
-
21
-
22
- class TaskRunRef(Generic[TWorkflowInput, R]):
23
- def __init__(
24
- self,
25
- standalone: "Standalone[TWorkflowInput, R]",
26
- workflow_run_ref: WorkflowRunRef,
27
- ):
28
- self._s = standalone
29
- self._wrr = workflow_run_ref
30
-
31
- self.workflow_run_id = workflow_run_ref.workflow_run_id
32
-
33
- def __str__(self) -> str:
34
- return self.workflow_run_id
35
-
36
- async def aio_result(self) -> R:
37
- result = await self._wrr.workflow_run_listener.aio_result(
38
- self._wrr.workflow_run_id
39
- )
40
- return self._s._extract_result(result)
41
-
42
- def result(self) -> R:
43
- result = self._wrr.result()
44
-
45
- return self._s._extract_result(result)
46
-
47
-
48
- class Standalone(BaseWorkflow[TWorkflowInput], Generic[TWorkflowInput, R]):
49
- def __init__(
50
- self, workflow: Workflow[TWorkflowInput], task: Task[TWorkflowInput, R]
51
- ) -> None:
52
- super().__init__(config=workflow.config, client=workflow.client)
53
-
54
- ## NOTE: This is a hack to assign the task back to the base workflow,
55
- ## since the decorator to mutate the tasks is not being called.
56
- self._default_tasks = [task]
57
-
58
- self._workflow = workflow
59
- self._task = task
60
-
61
- return_type = get_type_hints(self._task.fn).get("return")
62
-
63
- self._output_validator = (
64
- return_type if is_basemodel_subclass(return_type) else None
65
- )
66
-
67
- self.config = self._workflow.config
68
-
69
- def _extract_result(self, result: dict[str, Any]) -> R:
70
- output = result.get(self._task.name)
71
-
72
- if not self._output_validator:
73
- return cast(R, output)
74
-
75
- return cast(R, self._output_validator.model_validate(output))
76
-
77
- def run(
78
- self,
79
- input: TWorkflowInput = cast(TWorkflowInput, EmptyModel()),
80
- options: TriggerWorkflowOptions = TriggerWorkflowOptions(),
81
- ) -> R:
82
- """
83
- Synchronously trigger a workflow run without waiting for it to complete.
84
- This method is useful for starting a workflow run and immediately returning a reference to the run without blocking while the workflow runs.
85
-
86
- :param input: The input data for the workflow.
87
- :param options: Additional options for workflow execution.
88
-
89
- :returns: A `WorkflowRunRef` object representing the reference to the workflow run.
90
- """
91
- return self._extract_result(self._workflow.run(input, options))
92
-
93
- async def aio_run(
94
- self,
95
- input: TWorkflowInput = cast(TWorkflowInput, EmptyModel()),
96
- options: TriggerWorkflowOptions = TriggerWorkflowOptions(),
97
- ) -> R:
98
- """
99
- Run the workflow asynchronously and wait for it to complete.
100
-
101
- This method triggers a workflow run, blocks until completion, and returns the final result.
102
-
103
- :param input: The input data for the workflow, must match the workflow's input type.
104
- :param options: Additional options for workflow execution like metadata and parent workflow ID.
105
-
106
- :returns: The result of the workflow execution as a dictionary.
107
- """
108
- result = await self._workflow.aio_run(input, options)
109
- return self._extract_result(result)
110
-
111
- def run_no_wait(
112
- self,
113
- input: TWorkflowInput = cast(TWorkflowInput, EmptyModel()),
114
- options: TriggerWorkflowOptions = TriggerWorkflowOptions(),
115
- ) -> TaskRunRef[TWorkflowInput, R]:
116
- """
117
- Run the workflow synchronously and wait for it to complete.
118
-
119
- This method triggers a workflow run, blocks until completion, and returns the final result.
120
-
121
- :param input: The input data for the workflow, must match the workflow's input type.
122
- :param options: Additional options for workflow execution like metadata and parent workflow ID.
123
-
124
- :returns: The result of the workflow execution as a dictionary.
125
- """
126
- ref = self._workflow.run_no_wait(input, options)
127
-
128
- return TaskRunRef[TWorkflowInput, R](self, ref)
129
-
130
- async def aio_run_no_wait(
131
- self,
132
- input: TWorkflowInput = cast(TWorkflowInput, EmptyModel()),
133
- options: TriggerWorkflowOptions = TriggerWorkflowOptions(),
134
- ) -> TaskRunRef[TWorkflowInput, R]:
135
- """
136
- Asynchronously trigger a workflow run without waiting for it to complete.
137
- This method is useful for starting a workflow run and immediately returning a reference to the run without blocking while the workflow runs.
138
-
139
- :param input: The input data for the workflow.
140
- :param options: Additional options for workflow execution.
141
-
142
- :returns: A `WorkflowRunRef` object representing the reference to the workflow run.
143
- """
144
- ref = await self._workflow.aio_run_no_wait(input, options)
145
-
146
- return TaskRunRef[TWorkflowInput, R](self, ref)
147
-
148
- def run_many(self, workflows: list[WorkflowRunTriggerConfig]) -> list[R]:
149
- """
150
- Run a workflow in bulk and wait for all runs to complete.
151
- This method triggers multiple workflow runs, blocks until all of them complete, and returns the final results.
152
-
153
- :param workflows: A list of `WorkflowRunTriggerConfig` objects, each representing a workflow run to be triggered.
154
- :returns: A list of results for each workflow run.
155
- """
156
- return [
157
- self._extract_result(result)
158
- for result in self._workflow.run_many(workflows)
159
- ]
160
-
161
- async def aio_run_many(self, workflows: list[WorkflowRunTriggerConfig]) -> list[R]:
162
- """
163
- Run a workflow in bulk and wait for all runs to complete.
164
- This method triggers multiple workflow runs, blocks until all of them complete, and returns the final results.
165
-
166
- :param workflows: A list of `WorkflowRunTriggerConfig` objects, each representing a workflow run to be triggered.
167
- :returns: A list of results for each workflow run.
168
- """
169
- return [
170
- self._extract_result(result)
171
- for result in await self._workflow.aio_run_many(workflows)
172
- ]
173
-
174
- def run_many_no_wait(
175
- self, workflows: list[WorkflowRunTriggerConfig]
176
- ) -> list[TaskRunRef[TWorkflowInput, R]]:
177
- """
178
- Run a workflow in bulk without waiting for all runs to complete.
179
-
180
- This method triggers multiple workflow runs and immediately returns a list of references to the runs without blocking while the workflows run.
181
-
182
- :param workflows: A list of `WorkflowRunTriggerConfig` objects, each representing a workflow run to be triggered.
183
- :returns: A list of `WorkflowRunRef` objects, each representing a reference to a workflow run.
184
- """
185
- refs = self._workflow.run_many_no_wait(workflows)
186
-
187
- return [TaskRunRef[TWorkflowInput, R](self, ref) for ref in refs]
188
-
189
- async def aio_run_many_no_wait(
190
- self, workflows: list[WorkflowRunTriggerConfig]
191
- ) -> list[TaskRunRef[TWorkflowInput, R]]:
192
- """
193
- Run a workflow in bulk without waiting for all runs to complete.
194
-
195
- This method triggers multiple workflow runs and immediately returns a list of references to the runs without blocking while the workflows run.
196
-
197
- :param workflows: A list of `WorkflowRunTriggerConfig` objects, each representing a workflow run to be triggered.
198
-
199
- :returns: A list of `WorkflowRunRef` objects, each representing a reference to a workflow run.
200
- """
201
- refs = await self._workflow.aio_run_many_no_wait(workflows)
202
-
203
- return [TaskRunRef[TWorkflowInput, R](self, ref) for ref in refs]
204
-
205
- def schedule(
206
- self,
207
- run_at: datetime,
208
- input: TWorkflowInput = cast(TWorkflowInput, EmptyModel()),
209
- options: ScheduleTriggerWorkflowOptions = ScheduleTriggerWorkflowOptions(),
210
- ) -> WorkflowVersion:
211
- """
212
- Schedule a workflow to run at a specific time.
213
-
214
- :param run_at: The time at which to schedule the workflow.
215
- :param input: The input data for the workflow.
216
- :param options: Additional options for workflow execution.
217
- :returns: A `WorkflowVersion` object representing the scheduled workflow.
218
- """
219
- return self._workflow.schedule(
220
- run_at=run_at,
221
- input=input,
222
- options=options,
223
- )
224
-
225
- async def aio_schedule(
226
- self,
227
- run_at: datetime,
228
- input: TWorkflowInput = cast(TWorkflowInput, EmptyModel()),
229
- options: ScheduleTriggerWorkflowOptions = ScheduleTriggerWorkflowOptions(),
230
- ) -> WorkflowVersion:
231
- """
232
- Schedule a workflow to run at a specific time.
233
-
234
- :param run_at: The time at which to schedule the workflow.
235
- :param input: The input data for the workflow.
236
- :param options: Additional options for workflow execution.
237
- :returns: A `WorkflowVersion` object representing the scheduled workflow.
238
- """
239
- return await self._workflow.aio_schedule(
240
- run_at=run_at,
241
- input=input,
242
- options=options,
243
- )
244
-
245
- def create_cron(
246
- self,
247
- cron_name: str,
248
- expression: str,
249
- input: TWorkflowInput = cast(TWorkflowInput, EmptyModel()),
250
- additional_metadata: JSONSerializableMapping = {},
251
- priority: int | None = None,
252
- ) -> CronWorkflows:
253
- """
254
- Create a cron job for the workflow.
255
-
256
- :param cron_name: The name of the cron job.
257
- :param expression: The cron expression that defines the schedule for the cron job.
258
- :param input: The input data for the workflow.
259
- :param additional_metadata: Additional metadata for the cron job.
260
- :param priority: The priority of the cron job. Must be between 1 and 3, inclusive.
261
-
262
- :returns: A `CronWorkflows` object representing the created cron job.
263
- """
264
- return self._workflow.create_cron(
265
- cron_name=cron_name,
266
- expression=expression,
267
- input=input,
268
- additional_metadata=additional_metadata,
269
- priority=priority,
270
- )
271
-
272
- async def aio_create_cron(
273
- self,
274
- cron_name: str,
275
- expression: str,
276
- input: TWorkflowInput = cast(TWorkflowInput, EmptyModel()),
277
- additional_metadata: JSONSerializableMapping = {},
278
- priority: int | None = None,
279
- ) -> CronWorkflows:
280
- """
281
- Create a cron job for the workflow.
282
-
283
- :param cron_name: The name of the cron job.
284
- :param expression: The cron expression that defines the schedule for the cron job.
285
- :param input: The input data for the workflow.
286
- :param additional_metadata: Additional metadata for the cron job.
287
- :param priority: The priority of the cron job. Must be between 1 and 3, inclusive.
288
-
289
- :returns: A `CronWorkflows` object representing the created cron job.
290
- """
291
- return await self._workflow.aio_create_cron(
292
- cron_name=cron_name,
293
- expression=expression,
294
- input=input,
295
- additional_metadata=additional_metadata,
296
- priority=priority,
297
- )
298
-
299
- def to_task(self) -> Task[TWorkflowInput, R]:
300
- return self._task
301
-
302
- def list_runs(
303
- self,
304
- since: datetime | None = None,
305
- until: datetime | None = None,
306
- limit: int = 100,
307
- offset: int | None = None,
308
- statuses: list[V1TaskStatus] | None = None,
309
- additional_metadata: dict[str, str] | None = None,
310
- worker_id: str | None = None,
311
- parent_task_external_id: str | None = None,
312
- triggering_event_external_id: str | None = None,
313
- ) -> list[V1TaskSummary]:
314
- """
315
- List runs of the workflow.
316
-
317
- :param since: The start time for the runs to be listed.
318
- :param until: The end time for the runs to be listed.
319
- :param limit: The maximum number of runs to be listed.
320
- :param offset: The offset for pagination.
321
- :param statuses: The statuses of the runs to be listed.
322
- :param additional_metadata: Additional metadata for filtering the runs.
323
- :param worker_id: The ID of the worker that ran the tasks.
324
- :param parent_task_external_id: The external ID of the parent task.
325
- :param triggering_event_external_id: The event id that triggered the task run.
326
-
327
- :returns: A list of `V1TaskSummary` objects representing the runs of the workflow.
328
- """
329
- workflows = self.client.workflows.list(workflow_name=self._workflow.name)
330
-
331
- if not workflows.rows:
332
- logger.warning(f"No runs found for {self.name}")
333
- return []
334
-
335
- workflow = workflows.rows[0]
336
-
337
- response = self.client.runs.list(
338
- workflow_ids=[workflow.metadata.id],
339
- since=since or datetime.now() - timedelta(days=1),
340
- only_tasks=True,
341
- offset=offset,
342
- limit=limit,
343
- statuses=statuses,
344
- until=until,
345
- additional_metadata=additional_metadata,
346
- worker_id=worker_id,
347
- parent_task_external_id=parent_task_external_id,
348
- triggering_event_external_id=triggering_event_external_id,
349
- )
350
-
351
- return response.rows
352
-
353
- async def aio_list_runs(
354
- self,
355
- since: datetime | None = None,
356
- until: datetime | None = None,
357
- limit: int = 100,
358
- offset: int | None = None,
359
- statuses: list[V1TaskStatus] | None = None,
360
- additional_metadata: dict[str, str] | None = None,
361
- worker_id: str | None = None,
362
- parent_task_external_id: str | None = None,
363
- triggering_event_external_id: str | None = None,
364
- ) -> list[V1TaskSummary]:
365
- """
366
- List runs of the workflow.
367
-
368
- :param since: The start time for the runs to be listed.
369
- :param until: The end time for the runs to be listed.
370
- :param limit: The maximum number of runs to be listed.
371
- :param offset: The offset for pagination.
372
- :param statuses: The statuses of the runs to be listed.
373
- :param additional_metadata: Additional metadata for filtering the runs.
374
- :param worker_id: The ID of the worker that ran the tasks.
375
- :param parent_task_external_id: The external ID of the parent task.
376
- :param triggering_event_external_id: The event id that triggered the task run.
377
-
378
- :returns: A list of `V1TaskSummary` objects representing the runs of the workflow.
379
- """
380
- return await asyncio.to_thread(
381
- self.list_runs,
382
- since=since or datetime.now() - timedelta(days=1),
383
- offset=offset,
384
- limit=limit,
385
- statuses=statuses,
386
- until=until,
387
- additional_metadata=additional_metadata,
388
- worker_id=worker_id,
389
- parent_task_external_id=parent_task_external_id,
390
- triggering_event_external_id=triggering_event_external_id,
391
- )