hatchet-sdk 1.18.1__py3-none-any.whl → 1.20.0__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 (234) hide show
  1. hatchet_sdk/clients/dispatcher/action_listener.py +0 -1
  2. hatchet_sdk/clients/dispatcher/dispatcher.py +0 -30
  3. hatchet_sdk/hatchet.py +0 -20
  4. hatchet_sdk/opentelemetry/instrumentor.py +1 -27
  5. hatchet_sdk/runnables/action.py +2 -5
  6. hatchet_sdk/runnables/task.py +0 -1
  7. hatchet_sdk/utils/opentelemetry.py +0 -1
  8. hatchet_sdk/worker/action_listener_process.py +0 -29
  9. hatchet_sdk/worker/runner/runner.py +1 -105
  10. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.20.0.dist-info}/METADATA +2 -3
  11. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.20.0.dist-info}/RECORD +13 -234
  12. hatchet_sdk/v0/__init__.py +0 -251
  13. hatchet_sdk/v0/client.py +0 -119
  14. hatchet_sdk/v0/clients/admin.py +0 -541
  15. hatchet_sdk/v0/clients/dispatcher/action_listener.py +0 -422
  16. hatchet_sdk/v0/clients/dispatcher/dispatcher.py +0 -204
  17. hatchet_sdk/v0/clients/event_ts.py +0 -28
  18. hatchet_sdk/v0/clients/events.py +0 -182
  19. hatchet_sdk/v0/clients/rest/__init__.py +0 -307
  20. hatchet_sdk/v0/clients/rest/api/__init__.py +0 -19
  21. hatchet_sdk/v0/clients/rest/api/api_token_api.py +0 -858
  22. hatchet_sdk/v0/clients/rest/api/default_api.py +0 -2259
  23. hatchet_sdk/v0/clients/rest/api/event_api.py +0 -2548
  24. hatchet_sdk/v0/clients/rest/api/github_api.py +0 -331
  25. hatchet_sdk/v0/clients/rest/api/healthcheck_api.py +0 -483
  26. hatchet_sdk/v0/clients/rest/api/log_api.py +0 -449
  27. hatchet_sdk/v0/clients/rest/api/metadata_api.py +0 -728
  28. hatchet_sdk/v0/clients/rest/api/rate_limits_api.py +0 -423
  29. hatchet_sdk/v0/clients/rest/api/slack_api.py +0 -577
  30. hatchet_sdk/v0/clients/rest/api/sns_api.py +0 -872
  31. hatchet_sdk/v0/clients/rest/api/step_run_api.py +0 -2202
  32. hatchet_sdk/v0/clients/rest/api/tenant_api.py +0 -4430
  33. hatchet_sdk/v0/clients/rest/api/user_api.py +0 -2888
  34. hatchet_sdk/v0/clients/rest/api/worker_api.py +0 -858
  35. hatchet_sdk/v0/clients/rest/api/workflow_api.py +0 -6312
  36. hatchet_sdk/v0/clients/rest/api/workflow_run_api.py +0 -1932
  37. hatchet_sdk/v0/clients/rest/api/workflow_runs_api.py +0 -610
  38. hatchet_sdk/v0/clients/rest/api_client.py +0 -759
  39. hatchet_sdk/v0/clients/rest/api_response.py +0 -22
  40. hatchet_sdk/v0/clients/rest/configuration.py +0 -611
  41. hatchet_sdk/v0/clients/rest/exceptions.py +0 -200
  42. hatchet_sdk/v0/clients/rest/models/__init__.py +0 -274
  43. hatchet_sdk/v0/clients/rest/models/accept_invite_request.py +0 -83
  44. hatchet_sdk/v0/clients/rest/models/api_error.py +0 -102
  45. hatchet_sdk/v0/clients/rest/models/api_errors.py +0 -100
  46. hatchet_sdk/v0/clients/rest/models/api_meta.py +0 -144
  47. hatchet_sdk/v0/clients/rest/models/api_meta_auth.py +0 -85
  48. hatchet_sdk/v0/clients/rest/models/api_meta_integration.py +0 -88
  49. hatchet_sdk/v0/clients/rest/models/api_meta_posthog.py +0 -90
  50. hatchet_sdk/v0/clients/rest/models/api_resource_meta.py +0 -98
  51. hatchet_sdk/v0/clients/rest/models/api_token.py +0 -105
  52. hatchet_sdk/v0/clients/rest/models/bulk_create_event_request.py +0 -100
  53. hatchet_sdk/v0/clients/rest/models/bulk_create_event_response.py +0 -110
  54. hatchet_sdk/v0/clients/rest/models/cancel_event_request.py +0 -85
  55. hatchet_sdk/v0/clients/rest/models/cancel_step_run_request.py +0 -83
  56. hatchet_sdk/v0/clients/rest/models/concurrency_limit_strategy.py +0 -39
  57. hatchet_sdk/v0/clients/rest/models/create_api_token_request.py +0 -92
  58. hatchet_sdk/v0/clients/rest/models/create_api_token_response.py +0 -83
  59. hatchet_sdk/v0/clients/rest/models/create_cron_workflow_trigger_request.py +0 -98
  60. hatchet_sdk/v0/clients/rest/models/create_event_request.py +0 -95
  61. hatchet_sdk/v0/clients/rest/models/create_pull_request_from_step_run.py +0 -83
  62. hatchet_sdk/v0/clients/rest/models/create_sns_integration_request.py +0 -85
  63. hatchet_sdk/v0/clients/rest/models/create_tenant_alert_email_group_request.py +0 -83
  64. hatchet_sdk/v0/clients/rest/models/create_tenant_invite_request.py +0 -86
  65. hatchet_sdk/v0/clients/rest/models/create_tenant_request.py +0 -84
  66. hatchet_sdk/v0/clients/rest/models/cron_workflows.py +0 -131
  67. hatchet_sdk/v0/clients/rest/models/cron_workflows_list.py +0 -110
  68. hatchet_sdk/v0/clients/rest/models/cron_workflows_method.py +0 -37
  69. hatchet_sdk/v0/clients/rest/models/cron_workflows_order_by_field.py +0 -37
  70. hatchet_sdk/v0/clients/rest/models/event.py +0 -143
  71. hatchet_sdk/v0/clients/rest/models/event_data.py +0 -83
  72. hatchet_sdk/v0/clients/rest/models/event_key_list.py +0 -98
  73. hatchet_sdk/v0/clients/rest/models/event_list.py +0 -110
  74. hatchet_sdk/v0/clients/rest/models/event_order_by_direction.py +0 -37
  75. hatchet_sdk/v0/clients/rest/models/event_order_by_field.py +0 -36
  76. hatchet_sdk/v0/clients/rest/models/event_update_cancel200_response.py +0 -85
  77. hatchet_sdk/v0/clients/rest/models/event_workflow_run_summary.py +0 -116
  78. hatchet_sdk/v0/clients/rest/models/events.py +0 -110
  79. hatchet_sdk/v0/clients/rest/models/get_step_run_diff_response.py +0 -100
  80. hatchet_sdk/v0/clients/rest/models/github_app_installation.py +0 -107
  81. hatchet_sdk/v0/clients/rest/models/github_branch.py +0 -86
  82. hatchet_sdk/v0/clients/rest/models/github_repo.py +0 -86
  83. hatchet_sdk/v0/clients/rest/models/info_get_version200_response.py +0 -83
  84. hatchet_sdk/v0/clients/rest/models/job.py +0 -132
  85. hatchet_sdk/v0/clients/rest/models/job_run.py +0 -176
  86. hatchet_sdk/v0/clients/rest/models/job_run_status.py +0 -41
  87. hatchet_sdk/v0/clients/rest/models/link_github_repository_request.py +0 -106
  88. hatchet_sdk/v0/clients/rest/models/list_api_tokens_response.py +0 -110
  89. hatchet_sdk/v0/clients/rest/models/list_github_app_installations_response.py +0 -112
  90. hatchet_sdk/v0/clients/rest/models/list_pull_requests_response.py +0 -100
  91. hatchet_sdk/v0/clients/rest/models/list_slack_webhooks.py +0 -110
  92. hatchet_sdk/v0/clients/rest/models/list_sns_integrations.py +0 -110
  93. hatchet_sdk/v0/clients/rest/models/log_line.py +0 -94
  94. hatchet_sdk/v0/clients/rest/models/log_line_level.py +0 -39
  95. hatchet_sdk/v0/clients/rest/models/log_line_list.py +0 -110
  96. hatchet_sdk/v0/clients/rest/models/log_line_order_by_direction.py +0 -37
  97. hatchet_sdk/v0/clients/rest/models/log_line_order_by_field.py +0 -36
  98. hatchet_sdk/v0/clients/rest/models/pagination_response.py +0 -95
  99. hatchet_sdk/v0/clients/rest/models/pull_request.py +0 -112
  100. hatchet_sdk/v0/clients/rest/models/pull_request_state.py +0 -37
  101. hatchet_sdk/v0/clients/rest/models/queue_metrics.py +0 -97
  102. hatchet_sdk/v0/clients/rest/models/rate_limit.py +0 -117
  103. hatchet_sdk/v0/clients/rest/models/rate_limit_list.py +0 -110
  104. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_direction.py +0 -37
  105. hatchet_sdk/v0/clients/rest/models/rate_limit_order_by_field.py +0 -38
  106. hatchet_sdk/v0/clients/rest/models/recent_step_runs.py +0 -118
  107. hatchet_sdk/v0/clients/rest/models/reject_invite_request.py +0 -83
  108. hatchet_sdk/v0/clients/rest/models/replay_event_request.py +0 -85
  109. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_request.py +0 -85
  110. hatchet_sdk/v0/clients/rest/models/replay_workflow_runs_response.py +0 -100
  111. hatchet_sdk/v0/clients/rest/models/rerun_step_run_request.py +0 -83
  112. hatchet_sdk/v0/clients/rest/models/schedule_workflow_run_request.py +0 -92
  113. hatchet_sdk/v0/clients/rest/models/scheduled_run_status.py +0 -42
  114. hatchet_sdk/v0/clients/rest/models/scheduled_workflows.py +0 -149
  115. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_list.py +0 -110
  116. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_method.py +0 -37
  117. hatchet_sdk/v0/clients/rest/models/scheduled_workflows_order_by_field.py +0 -37
  118. hatchet_sdk/v0/clients/rest/models/semaphore_slots.py +0 -113
  119. hatchet_sdk/v0/clients/rest/models/slack_webhook.py +0 -127
  120. hatchet_sdk/v0/clients/rest/models/sns_integration.py +0 -114
  121. hatchet_sdk/v0/clients/rest/models/step.py +0 -123
  122. hatchet_sdk/v0/clients/rest/models/step_run.py +0 -202
  123. hatchet_sdk/v0/clients/rest/models/step_run_archive.py +0 -142
  124. hatchet_sdk/v0/clients/rest/models/step_run_archive_list.py +0 -110
  125. hatchet_sdk/v0/clients/rest/models/step_run_diff.py +0 -91
  126. hatchet_sdk/v0/clients/rest/models/step_run_event.py +0 -122
  127. hatchet_sdk/v0/clients/rest/models/step_run_event_list.py +0 -110
  128. hatchet_sdk/v0/clients/rest/models/step_run_event_reason.py +0 -52
  129. hatchet_sdk/v0/clients/rest/models/step_run_event_severity.py +0 -38
  130. hatchet_sdk/v0/clients/rest/models/step_run_status.py +0 -44
  131. hatchet_sdk/v0/clients/rest/models/tenant.py +0 -118
  132. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group.py +0 -98
  133. hatchet_sdk/v0/clients/rest/models/tenant_alert_email_group_list.py +0 -112
  134. hatchet_sdk/v0/clients/rest/models/tenant_alerting_settings.py +0 -143
  135. hatchet_sdk/v0/clients/rest/models/tenant_invite.py +0 -120
  136. hatchet_sdk/v0/clients/rest/models/tenant_invite_list.py +0 -110
  137. hatchet_sdk/v0/clients/rest/models/tenant_list.py +0 -110
  138. hatchet_sdk/v0/clients/rest/models/tenant_member.py +0 -123
  139. hatchet_sdk/v0/clients/rest/models/tenant_member_list.py +0 -110
  140. hatchet_sdk/v0/clients/rest/models/tenant_member_role.py +0 -38
  141. hatchet_sdk/v0/clients/rest/models/tenant_queue_metrics.py +0 -116
  142. hatchet_sdk/v0/clients/rest/models/tenant_resource.py +0 -40
  143. hatchet_sdk/v0/clients/rest/models/tenant_resource_limit.py +0 -135
  144. hatchet_sdk/v0/clients/rest/models/tenant_resource_policy.py +0 -102
  145. hatchet_sdk/v0/clients/rest/models/tenant_step_run_queue_metrics.py +0 -83
  146. hatchet_sdk/v0/clients/rest/models/trigger_workflow_run_request.py +0 -91
  147. hatchet_sdk/v0/clients/rest/models/update_tenant_alert_email_group_request.py +0 -83
  148. hatchet_sdk/v0/clients/rest/models/update_tenant_invite_request.py +0 -85
  149. hatchet_sdk/v0/clients/rest/models/update_tenant_request.py +0 -137
  150. hatchet_sdk/v0/clients/rest/models/update_worker_request.py +0 -87
  151. hatchet_sdk/v0/clients/rest/models/user.py +0 -126
  152. hatchet_sdk/v0/clients/rest/models/user_change_password_request.py +0 -88
  153. hatchet_sdk/v0/clients/rest/models/user_login_request.py +0 -86
  154. hatchet_sdk/v0/clients/rest/models/user_register_request.py +0 -91
  155. hatchet_sdk/v0/clients/rest/models/user_tenant_memberships_list.py +0 -110
  156. hatchet_sdk/v0/clients/rest/models/user_tenant_public.py +0 -86
  157. hatchet_sdk/v0/clients/rest/models/webhook_worker.py +0 -100
  158. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_request.py +0 -94
  159. hatchet_sdk/v0/clients/rest/models/webhook_worker_create_response.py +0 -98
  160. hatchet_sdk/v0/clients/rest/models/webhook_worker_created.py +0 -102
  161. hatchet_sdk/v0/clients/rest/models/webhook_worker_list_response.py +0 -110
  162. hatchet_sdk/v0/clients/rest/models/webhook_worker_request.py +0 -102
  163. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_list_response.py +0 -104
  164. hatchet_sdk/v0/clients/rest/models/webhook_worker_request_method.py +0 -38
  165. hatchet_sdk/v0/clients/rest/models/worker.py +0 -239
  166. hatchet_sdk/v0/clients/rest/models/worker_label.py +0 -102
  167. hatchet_sdk/v0/clients/rest/models/worker_list.py +0 -110
  168. hatchet_sdk/v0/clients/rest/models/worker_runtime_info.py +0 -103
  169. hatchet_sdk/v0/clients/rest/models/worker_runtime_sdks.py +0 -38
  170. hatchet_sdk/v0/clients/rest/models/worker_type.py +0 -38
  171. hatchet_sdk/v0/clients/rest/models/workflow.py +0 -165
  172. hatchet_sdk/v0/clients/rest/models/workflow_concurrency.py +0 -107
  173. hatchet_sdk/v0/clients/rest/models/workflow_deployment_config.py +0 -136
  174. hatchet_sdk/v0/clients/rest/models/workflow_kind.py +0 -38
  175. hatchet_sdk/v0/clients/rest/models/workflow_list.py +0 -120
  176. hatchet_sdk/v0/clients/rest/models/workflow_metrics.py +0 -97
  177. hatchet_sdk/v0/clients/rest/models/workflow_run.py +0 -188
  178. hatchet_sdk/v0/clients/rest/models/workflow_run_cancel200_response.py +0 -85
  179. hatchet_sdk/v0/clients/rest/models/workflow_run_list.py +0 -110
  180. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_direction.py +0 -37
  181. hatchet_sdk/v0/clients/rest/models/workflow_run_order_by_field.py +0 -39
  182. hatchet_sdk/v0/clients/rest/models/workflow_run_shape.py +0 -186
  183. hatchet_sdk/v0/clients/rest/models/workflow_run_status.py +0 -42
  184. hatchet_sdk/v0/clients/rest/models/workflow_run_triggered_by.py +0 -112
  185. hatchet_sdk/v0/clients/rest/models/workflow_runs_cancel_request.py +0 -85
  186. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics.py +0 -94
  187. hatchet_sdk/v0/clients/rest/models/workflow_runs_metrics_counts.py +0 -104
  188. hatchet_sdk/v0/clients/rest/models/workflow_tag.py +0 -84
  189. hatchet_sdk/v0/clients/rest/models/workflow_trigger_cron_ref.py +0 -86
  190. hatchet_sdk/v0/clients/rest/models/workflow_trigger_event_ref.py +0 -86
  191. hatchet_sdk/v0/clients/rest/models/workflow_triggers.py +0 -141
  192. hatchet_sdk/v0/clients/rest/models/workflow_update_request.py +0 -85
  193. hatchet_sdk/v0/clients/rest/models/workflow_version.py +0 -170
  194. hatchet_sdk/v0/clients/rest/models/workflow_version_concurrency.py +0 -114
  195. hatchet_sdk/v0/clients/rest/models/workflow_version_definition.py +0 -85
  196. hatchet_sdk/v0/clients/rest/models/workflow_version_meta.py +0 -123
  197. hatchet_sdk/v0/clients/rest/models/workflow_workers_count.py +0 -95
  198. hatchet_sdk/v0/clients/rest/rest.py +0 -187
  199. hatchet_sdk/v0/clients/rest/tenacity_utils.py +0 -39
  200. hatchet_sdk/v0/clients/rest_client.py +0 -622
  201. hatchet_sdk/v0/clients/run_event_listener.py +0 -260
  202. hatchet_sdk/v0/clients/workflow_listener.py +0 -277
  203. hatchet_sdk/v0/connection.py +0 -63
  204. hatchet_sdk/v0/context/__init__.py +0 -1
  205. hatchet_sdk/v0/context/context.py +0 -446
  206. hatchet_sdk/v0/context/worker_context.py +0 -28
  207. hatchet_sdk/v0/features/cron.py +0 -286
  208. hatchet_sdk/v0/features/scheduled.py +0 -248
  209. hatchet_sdk/v0/hatchet.py +0 -310
  210. hatchet_sdk/v0/labels.py +0 -10
  211. hatchet_sdk/v0/loader.py +0 -244
  212. hatchet_sdk/v0/metadata.py +0 -2
  213. hatchet_sdk/v0/opentelemetry/instrumentor.py +0 -393
  214. hatchet_sdk/v0/rate_limit.py +0 -126
  215. hatchet_sdk/v0/semver.py +0 -30
  216. hatchet_sdk/v0/token.py +0 -27
  217. hatchet_sdk/v0/utils/aio_utils.py +0 -137
  218. hatchet_sdk/v0/utils/backoff.py +0 -9
  219. hatchet_sdk/v0/utils/types.py +0 -8
  220. hatchet_sdk/v0/utils/typing.py +0 -12
  221. hatchet_sdk/v0/v2/callable.py +0 -202
  222. hatchet_sdk/v0/v2/concurrency.py +0 -47
  223. hatchet_sdk/v0/v2/hatchet.py +0 -224
  224. hatchet_sdk/v0/worker/__init__.py +0 -1
  225. hatchet_sdk/v0/worker/action_listener_process.py +0 -294
  226. hatchet_sdk/v0/worker/runner/run_loop_manager.py +0 -112
  227. hatchet_sdk/v0/worker/runner/runner.py +0 -460
  228. hatchet_sdk/v0/worker/runner/utils/capture_logs.py +0 -81
  229. hatchet_sdk/v0/worker/runner/utils/error_with_traceback.py +0 -6
  230. hatchet_sdk/v0/worker/worker.py +0 -391
  231. hatchet_sdk/v0/workflow.py +0 -261
  232. hatchet_sdk/v0/workflow_run.py +0 -59
  233. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.20.0.dist-info}/WHEEL +0 -0
  234. {hatchet_sdk-1.18.1.dist-info → hatchet_sdk-1.20.0.dist-info}/entry_points.txt +0 -0
@@ -231,7 +231,6 @@ class ActionListener:
231
231
  tenant_id=assigned_action.tenantId,
232
232
  worker_id=self.worker_id,
233
233
  workflow_run_id=assigned_action.workflowRunId,
234
- get_group_key_run_id=assigned_action.getGroupKeyRunId,
235
234
  job_id=assigned_action.jobId,
236
235
  job_name=assigned_action.jobName,
237
236
  job_run_id=assigned_action.jobRunId,
@@ -18,8 +18,6 @@ from hatchet_sdk.contracts.dispatcher_pb2 import (
18
18
  STEP_EVENT_TYPE_COMPLETED,
19
19
  STEP_EVENT_TYPE_FAILED,
20
20
  ActionEventResponse,
21
- GroupKeyActionEvent,
22
- GroupKeyActionEventType,
23
21
  OverridesData,
24
22
  RefreshTimeoutRequest,
25
23
  ReleaseSlotRequest,
@@ -151,34 +149,6 @@ class DispatcherClient:
151
149
  ),
152
150
  )
153
151
 
154
- async def send_group_key_action_event(
155
- self, action: Action, event_type: GroupKeyActionEventType, payload: str
156
- ) -> grpc.aio.UnaryUnaryCall[GroupKeyActionEvent, ActionEventResponse]:
157
- if not self.aio_client:
158
- aio_conn = new_conn(self.config, True)
159
- self.aio_client = DispatcherStub(aio_conn)
160
-
161
- event_timestamp = Timestamp()
162
- event_timestamp.GetCurrentTime()
163
-
164
- event = GroupKeyActionEvent(
165
- workerId=action.worker_id,
166
- workflowRunId=action.workflow_run_id,
167
- getGroupKeyRunId=action.get_group_key_run_id,
168
- actionId=action.action_id,
169
- eventTimestamp=event_timestamp,
170
- eventType=event_type,
171
- eventPayload=payload,
172
- )
173
-
174
- return cast(
175
- grpc.aio.UnaryUnaryCall[GroupKeyActionEvent, ActionEventResponse],
176
- await self.aio_client.SendGroupKeyActionEvent(
177
- event,
178
- metadata=get_metadata(self.token),
179
- ),
180
- )
181
-
182
152
  def put_overrides_data(self, data: OverridesData) -> ActionEventResponse:
183
153
  client = self._get_or_create_client()
184
154
 
hatchet_sdk/hatchet.py CHANGED
@@ -2,7 +2,6 @@ import asyncio
2
2
  import logging
3
3
  from collections.abc import Callable
4
4
  from datetime import timedelta
5
- from functools import cached_property
6
5
  from typing import Any, Concatenate, ParamSpec, cast, overload
7
6
 
8
7
  from hatchet_sdk import Context, DurableContext
@@ -10,7 +9,6 @@ from hatchet_sdk.client import Client
10
9
  from hatchet_sdk.clients.dispatcher.dispatcher import DispatcherClient
11
10
  from hatchet_sdk.clients.events import EventClient
12
11
  from hatchet_sdk.clients.listeners.run_event_listener import RunEventListenerClient
13
- from hatchet_sdk.clients.rest.models.tenant_version import TenantVersion
14
12
  from hatchet_sdk.config import ClientConfig
15
13
  from hatchet_sdk.features.cel import CELClient
16
14
  from hatchet_sdk.features.cron import CronClient
@@ -65,11 +63,6 @@ class Hatchet:
65
63
  client if client else Client(config=config or ClientConfig(), debug=debug)
66
64
  )
67
65
 
68
- if self.tenant_engine_version != TenantVersion.V1:
69
- logger.warning(
70
- "🚨⚠️‼️ YOU ARE USING A V0 ENGINE WITH A V1 SDK, WHICH IS NOT SUPPORTED. PLEASE UPGRADE YOUR ENGINE TO V1.🚨⚠️‼️"
71
- )
72
-
73
66
  @property
74
67
  def cel(self) -> CELClient:
75
68
  """
@@ -179,19 +172,6 @@ class Hatchet:
179
172
  """
180
173
  return self._client.config.namespace
181
174
 
182
- @cached_property
183
- def tenant_engine_version(self) -> TenantVersion:
184
- """
185
- Get the version of the Hatchet engine running in your tenant.
186
- """
187
- try:
188
- return self._client.tenant.get().version
189
- except Exception:
190
- ## Nothing we can do here - if this fails, it's probably
191
- ## because they don't have this endpoint yet, so we need to just
192
- ## assume V1 to swallow the warning.
193
- return TenantVersion.V1
194
-
195
175
  def worker(
196
176
  self,
197
177
  name: str,
@@ -216,11 +216,7 @@ class HatchetInstrumentor(BaseInstrumentor): # type: ignore[misc]
216
216
  "worker.runner.runner.Runner.handle_start_step_run",
217
217
  self._wrap_handle_start_step_run,
218
218
  )
219
- wrap_function_wrapper(
220
- hatchet_sdk,
221
- "worker.runner.runner.Runner.handle_start_group_key_run",
222
- self._wrap_handle_get_group_key_run,
223
- )
219
+
224
220
  wrap_function_wrapper(
225
221
  hatchet_sdk,
226
222
  "worker.runner.runner.Runner.handle_cancel_action",
@@ -310,27 +306,6 @@ class HatchetInstrumentor(BaseInstrumentor): # type: ignore[misc]
310
306
 
311
307
  return result
312
308
 
313
- ## IMPORTANT: Keep these types in sync with the wrapped method's signature
314
- async def _wrap_handle_get_group_key_run(
315
- self,
316
- wrapped: Callable[[Action], Coroutine[None, None, Exception | None]],
317
- instance: Runner,
318
- args: tuple[Action],
319
- kwargs: Any,
320
- ) -> Exception | None:
321
- action = args[0]
322
-
323
- with self._tracer.start_as_current_span(
324
- "hatchet.get_group_key_run",
325
- attributes=action.get_otel_attributes(self.config),
326
- ) as span:
327
- result = await wrapped(*args, **kwargs)
328
-
329
- if isinstance(result, Exception):
330
- span.set_status(StatusCode.ERROR, str(result))
331
-
332
- return result
333
-
334
309
  ## IMPORTANT: Keep these types in sync with the wrapped method's signature
335
310
  async def _wrap_handle_cancel_action(
336
311
  self,
@@ -719,7 +694,6 @@ class HatchetInstrumentor(BaseInstrumentor): # type: ignore[misc]
719
694
  self.meter_provider = NoOpMeterProvider()
720
695
 
721
696
  unwrap(hatchet_sdk, "worker.runner.runner.Runner.handle_start_step_run")
722
- unwrap(hatchet_sdk, "worker.runner.runner.Runner.handle_start_group_key_run")
723
697
  unwrap(hatchet_sdk, "worker.runner.runner.Runner.handle_cancel_action")
724
698
  unwrap(hatchet_sdk, "clients.events.EventClient.push")
725
699
  unwrap(hatchet_sdk, "clients.events.EventClient.bulk_push")
@@ -49,16 +49,16 @@ class ActionPayload(BaseModel):
49
49
  class ActionType(str, Enum):
50
50
  START_STEP_RUN = "START_STEP_RUN"
51
51
  CANCEL_STEP_RUN = "CANCEL_STEP_RUN"
52
- START_GET_GROUP_KEY = "START_GET_GROUP_KEY"
53
52
 
54
53
 
55
54
  class Action(BaseModel):
55
+ model_config = ConfigDict(extra="ignore")
56
+
56
57
  worker_id: str
57
58
  tenant_id: str
58
59
  workflow_run_id: str
59
60
  workflow_id: str | None = None
60
61
  workflow_version_id: str | None = None
61
- get_group_key_run_id: str
62
62
  job_id: str
63
63
  job_name: str
64
64
  job_run_id: str
@@ -101,7 +101,6 @@ class Action(BaseModel):
101
101
  OTelAttribute.ACTION_PAYLOAD: payload_str,
102
102
  OTelAttribute.WORKFLOW_NAME: self.job_name,
103
103
  OTelAttribute.ACTION_NAME: self.action_id,
104
- OTelAttribute.GET_GROUP_KEY_RUN_ID: self.get_group_key_run_id,
105
104
  OTelAttribute.WORKFLOW_ID: self.workflow_id,
106
105
  OTelAttribute.WORKFLOW_VERSION_ID: self.workflow_version_id,
107
106
  }
@@ -119,6 +118,4 @@ class Action(BaseModel):
119
118
  It's used when storing references to a task, a context, etc. in a dictionary so that
120
119
  we can look up those items in the dictionary by a unique key.
121
120
  """
122
- if self.action_type == ActionType.START_GET_GROUP_KEY:
123
- return f"{self.get_group_key_run_id}/{self.retry_count}"
124
121
  return f"{self.step_run_id}/{self.retry_count}"
@@ -299,7 +299,6 @@ class Task(Generic[TWorkflowInput, R]):
299
299
  tenant_id=self.workflow.client.config.tenant_id,
300
300
  worker_id="mock-worker-id",
301
301
  workflow_run_id="mock-workflow-run-id",
302
- get_group_key_run_id="mock-get-group-key-run-id",
303
302
  job_id="mock-job-id",
304
303
  job_name="mock-job-name",
305
304
  job_run_id="mock-job-run-id",
@@ -16,7 +16,6 @@ class OTelAttribute(str, Enum):
16
16
  ACTION_NAME = "action_name"
17
17
  CHILD_WORKFLOW_INDEX = "child_workflow_index"
18
18
  CHILD_WORKFLOW_KEY = "child_workflow_key"
19
- GET_GROUP_KEY_RUN_ID = "get_group_key_run_id"
20
19
  PARENT_WORKFLOW_RUN_ID = "parent_workflow_run_id"
21
20
  RETRY_COUNT = "retry_count"
22
21
  STEP_ID = "step_id"
@@ -18,10 +18,8 @@ from hatchet_sdk.clients.dispatcher.dispatcher import DispatcherClient
18
18
  from hatchet_sdk.clients.rest.models.update_worker_request import UpdateWorkerRequest
19
19
  from hatchet_sdk.config import ClientConfig
20
20
  from hatchet_sdk.contracts.dispatcher_pb2 import (
21
- GROUP_KEY_EVENT_TYPE_STARTED,
22
21
  STEP_EVENT_TYPE_STARTED,
23
22
  ActionEventResponse,
24
- GroupKeyActionEvent,
25
23
  StepActionEvent,
26
24
  )
27
25
  from hatchet_sdk.logger import logger
@@ -80,11 +78,6 @@ class WorkerActionListenerProcess:
80
78
  self.step_action_events: set[
81
79
  asyncio.Task[UnaryUnaryCall[StepActionEvent, ActionEventResponse] | None]
82
80
  ] = set()
83
- self.group_key_action_events: set[
84
- asyncio.Task[
85
- UnaryUnaryCall[GroupKeyActionEvent, ActionEventResponse] | None
86
- ]
87
- ] = set()
88
81
 
89
82
  if self.debug:
90
83
  logger.setLevel(logging.DEBUG)
@@ -213,16 +206,6 @@ class WorkerActionListenerProcess:
213
206
  )
214
207
  case ActionType.CANCEL_STEP_RUN:
215
208
  logger.debug("unimplemented event send")
216
- case ActionType.START_GET_GROUP_KEY:
217
- get_group_key_task = asyncio.create_task(
218
- self.dispatcher_client.send_group_key_action_event(
219
- event.action, event.type, event.payload
220
- )
221
- )
222
- self.group_key_action_events.add(get_group_key_task)
223
- get_group_key_task.add_done_callback(
224
- lambda t: self.group_key_action_events.discard(t)
225
- )
226
209
  case _:
227
210
  logger.error("unknown action type for event send")
228
211
  except Exception:
@@ -273,18 +256,6 @@ class WorkerActionListenerProcess:
273
256
 
274
257
  case ActionType.CANCEL_STEP_RUN:
275
258
  logger.info(f"rx: cancel step run: {action.step_run_id}")
276
- case ActionType.START_GET_GROUP_KEY:
277
- self.event_queue.put(
278
- ActionEvent(
279
- action=action,
280
- type=GROUP_KEY_EVENT_TYPE_STARTED, # TODO ack type
281
- payload="",
282
- should_not_retry=False,
283
- )
284
- )
285
- logger.info(
286
- f"rx: start group key: {action.get_group_key_run_id}"
287
- )
288
259
  case _:
289
260
  logger.error(
290
261
  f"rx: unknown action type ({action.action_type}): {action.action_type}"
@@ -23,9 +23,6 @@ from hatchet_sdk.config import ClientConfig
23
23
  from hatchet_sdk.context.context import Context, DurableContext
24
24
  from hatchet_sdk.context.worker_context import WorkerContext
25
25
  from hatchet_sdk.contracts.dispatcher_pb2 import (
26
- GROUP_KEY_EVENT_TYPE_COMPLETED,
27
- GROUP_KEY_EVENT_TYPE_FAILED,
28
- GROUP_KEY_EVENT_TYPE_STARTED,
29
26
  STEP_EVENT_TYPE_COMPLETED,
30
27
  STEP_EVENT_TYPE_FAILED,
31
28
  STEP_EVENT_TYPE_STARTED,
@@ -142,10 +139,6 @@ class Runner:
142
139
  log = f"cancel: step run: {action.action_id}/{action.step_run_id}/{action.retry_count}"
143
140
  logger.info(log)
144
141
  t = asyncio.create_task(self.handle_cancel_action(action))
145
- case ActionType.START_GET_GROUP_KEY:
146
- log = f"run: get group key: {action.action_id}/{action.get_group_key_run_id}"
147
- logger.info(log)
148
- t = asyncio.create_task(self.handle_start_group_key_run(action))
149
142
  case _:
150
143
  log = f"unknown action type: {action.action_type}"
151
144
  logger.error(log)
@@ -218,67 +211,6 @@ class Runner:
218
211
 
219
212
  return inner_callback
220
213
 
221
- def group_key_run_callback(
222
- self, action: Action
223
- ) -> Callable[[asyncio.Task[Any]], None]:
224
- def inner_callback(task: asyncio.Task[Any]) -> None:
225
- self.cleanup_run_id(action.key)
226
-
227
- if task.cancelled():
228
- return
229
-
230
- try:
231
- output = task.result()
232
- except Exception as e:
233
- exc = TaskRunError.from_exception(e, action.step_run_id)
234
-
235
- self.event_queue.put(
236
- ActionEvent(
237
- action=action,
238
- type=GROUP_KEY_EVENT_TYPE_FAILED,
239
- payload=exc.serialize(include_metadata=True),
240
- should_not_retry=False,
241
- )
242
- )
243
-
244
- logger.exception(
245
- f"failed step run: {action.action_id}/{action.step_run_id}\n{exc.serialize(include_metadata=False)}"
246
- )
247
-
248
- return
249
-
250
- try:
251
- output = self.serialize_output(output)
252
-
253
- self.event_queue.put(
254
- ActionEvent(
255
- action=action,
256
- type=GROUP_KEY_EVENT_TYPE_COMPLETED,
257
- payload=output,
258
- should_not_retry=False,
259
- )
260
- )
261
- except IllegalTaskOutputError as e:
262
- exc = TaskRunError.from_exception(e, action.step_run_id)
263
- self.event_queue.put(
264
- ActionEvent(
265
- action=action,
266
- type=STEP_EVENT_TYPE_FAILED,
267
- payload=exc.serialize(include_metadata=True),
268
- should_not_retry=False,
269
- )
270
- )
271
-
272
- logger.exception(
273
- f"failed step run: {action.action_id}/{action.step_run_id}\n{exc.serialize(include_metadata=False)}"
274
- )
275
-
276
- return
277
-
278
- logger.info(f"finished step run: {action.action_id}/{action.step_run_id}")
279
-
280
- return inner_callback
281
-
282
214
  def thread_action_func(
283
215
  self,
284
216
  ctx: Context,
@@ -286,7 +218,7 @@ class Runner:
286
218
  action: Action,
287
219
  dependencies: dict[str, Any],
288
220
  ) -> R:
289
- if action.step_run_id or action.get_group_key_run_id:
221
+ if action.step_run_id:
290
222
  self.threads[action.key] = current_thread()
291
223
 
292
224
  return task.call(ctx, dependencies)
@@ -485,42 +417,6 @@ class Runner:
485
417
 
486
418
  return None
487
419
 
488
- ## IMPORTANT: Keep this method's signature in sync with the wrapper in the OTel instrumentor
489
- async def handle_start_group_key_run(self, action: Action) -> Exception | None:
490
- action_name = action.action_id
491
- context = self.create_context(action)
492
-
493
- self.contexts[action.key] = context
494
-
495
- # Find the corresponding action function from the registry
496
- action_func = self.action_registry.get(action_name)
497
-
498
- if action_func:
499
- # send an event that the group key run has started
500
- self.event_queue.put(
501
- ActionEvent(
502
- action=action,
503
- type=GROUP_KEY_EVENT_TYPE_STARTED,
504
- payload="",
505
- should_not_retry=False,
506
- )
507
- )
508
-
509
- loop = asyncio.get_event_loop()
510
- task = loop.create_task(
511
- self.async_wrapped_action_func(context, action_func, action)
512
- )
513
-
514
- task.add_done_callback(self.group_key_run_callback(action))
515
- self.tasks[action.key] = task
516
-
517
- try:
518
- await task
519
- except Exception as e:
520
- return e
521
-
522
- return None
523
-
524
420
  def force_kill_thread(self, thread: Thread) -> None:
525
421
  """Terminate a python threading.Thread."""
526
422
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hatchet-sdk
3
- Version: 1.18.1
3
+ Version: 1.20.0
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Alexander Belanger
@@ -14,7 +14,6 @@ Classifier: Programming Language :: Python :: 3.12
14
14
  Provides-Extra: otel
15
15
  Provides-Extra: v0-sdk
16
16
  Requires-Dist: aiohttp (>=3.10.5,<4.0.0)
17
- Requires-Dist: cel-python (>=0.4.0,<0.5.0) ; extra == "v0-sdk"
18
17
  Requires-Dist: grpcio (>=1.64.1,!=1.68.*) ; python_version < "3.13"
19
18
  Requires-Dist: grpcio (>=1.69.0) ; python_version >= "3.13"
20
19
  Requires-Dist: grpcio-tools (>=1.64.1,!=1.68.*) ; python_version < "3.13"
@@ -31,7 +30,7 @@ Requires-Dist: pydantic (>=2.6.3,<3.0.0)
31
30
  Requires-Dist: pydantic-settings (>=2.7.1,<3.0.0)
32
31
  Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
33
32
  Requires-Dist: tenacity (>=8.4.1)
34
- Requires-Dist: urllib3 (>=1.26.20)
33
+ Requires-Dist: urllib3 (>=2.5.0,<3.0.0)
35
34
  Description-Content-Type: text/markdown
36
35
 
37
36
  # Hatchet Python SDK