hatchet-sdk 0.46.1__tar.gz → 0.47.0__tar.gz

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 (236) hide show
  1. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/PKG-INFO +2 -2
  2. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/workflow_listener.py +7 -3
  3. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/context/context.py +41 -0
  4. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/loader.py +11 -0
  5. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/opentelemetry/instrumentor.py +104 -31
  6. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/utils/aio_utils.py +2 -2
  7. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/worker/runner/runner.py +7 -1
  8. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/workflow_run.py +9 -7
  9. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/pyproject.toml +3 -2
  10. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/README.md +0 -0
  11. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/__init__.py +0 -0
  12. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/client.py +0 -0
  13. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/admin.py +0 -0
  14. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/dispatcher/action_listener.py +0 -0
  15. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/dispatcher/dispatcher.py +0 -0
  16. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/event_ts.py +0 -0
  17. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/events.py +0 -0
  18. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/__init__.py +0 -0
  19. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/__init__.py +0 -0
  20. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/api_token_api.py +0 -0
  21. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/default_api.py +0 -0
  22. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/event_api.py +0 -0
  23. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/github_api.py +0 -0
  24. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/healthcheck_api.py +0 -0
  25. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/log_api.py +0 -0
  26. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/metadata_api.py +0 -0
  27. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/rate_limits_api.py +0 -0
  28. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/slack_api.py +0 -0
  29. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/sns_api.py +0 -0
  30. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/step_run_api.py +0 -0
  31. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/tenant_api.py +0 -0
  32. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/user_api.py +0 -0
  33. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/worker_api.py +0 -0
  34. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/workflow_api.py +0 -0
  35. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/workflow_run_api.py +0 -0
  36. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api/workflow_runs_api.py +0 -0
  37. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api_client.py +0 -0
  38. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/api_response.py +0 -0
  39. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/configuration.py +0 -0
  40. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/exceptions.py +0 -0
  41. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/__init__.py +0 -0
  42. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/accept_invite_request.py +0 -0
  43. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/api_error.py +0 -0
  44. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/api_errors.py +0 -0
  45. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/api_meta.py +0 -0
  46. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/api_meta_auth.py +0 -0
  47. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/api_meta_integration.py +0 -0
  48. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/api_meta_posthog.py +0 -0
  49. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/api_resource_meta.py +0 -0
  50. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/api_token.py +0 -0
  51. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/bulk_create_event_request.py +0 -0
  52. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/bulk_create_event_response.py +0 -0
  53. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/cancel_event_request.py +0 -0
  54. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/cancel_step_run_request.py +0 -0
  55. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/concurrency_limit_strategy.py +0 -0
  56. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/create_api_token_request.py +0 -0
  57. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/create_api_token_response.py +0 -0
  58. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/create_cron_workflow_trigger_request.py +0 -0
  59. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/create_event_request.py +0 -0
  60. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/create_pull_request_from_step_run.py +0 -0
  61. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/create_sns_integration_request.py +0 -0
  62. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/create_tenant_alert_email_group_request.py +0 -0
  63. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/create_tenant_invite_request.py +0 -0
  64. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/create_tenant_request.py +0 -0
  65. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/cron_workflows.py +0 -0
  66. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/cron_workflows_list.py +0 -0
  67. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/cron_workflows_method.py +0 -0
  68. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/cron_workflows_order_by_field.py +0 -0
  69. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/event.py +0 -0
  70. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/event_data.py +0 -0
  71. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/event_key_list.py +0 -0
  72. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/event_list.py +0 -0
  73. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/event_order_by_direction.py +0 -0
  74. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/event_order_by_field.py +0 -0
  75. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/event_update_cancel200_response.py +0 -0
  76. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/event_workflow_run_summary.py +0 -0
  77. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/events.py +0 -0
  78. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/get_step_run_diff_response.py +0 -0
  79. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/github_app_installation.py +0 -0
  80. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/github_branch.py +0 -0
  81. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/github_repo.py +0 -0
  82. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/info_get_version200_response.py +0 -0
  83. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/job.py +0 -0
  84. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/job_run.py +0 -0
  85. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/job_run_status.py +0 -0
  86. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/link_github_repository_request.py +0 -0
  87. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/list_api_tokens_response.py +0 -0
  88. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/list_github_app_installations_response.py +0 -0
  89. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/list_pull_requests_response.py +0 -0
  90. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/list_slack_webhooks.py +0 -0
  91. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/list_sns_integrations.py +0 -0
  92. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/log_line.py +0 -0
  93. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/log_line_level.py +0 -0
  94. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/log_line_list.py +0 -0
  95. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/log_line_order_by_direction.py +0 -0
  96. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/log_line_order_by_field.py +0 -0
  97. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/pagination_response.py +0 -0
  98. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/pull_request.py +0 -0
  99. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/pull_request_state.py +0 -0
  100. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/queue_metrics.py +0 -0
  101. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/rate_limit.py +0 -0
  102. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/rate_limit_list.py +0 -0
  103. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/rate_limit_order_by_direction.py +0 -0
  104. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/rate_limit_order_by_field.py +0 -0
  105. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/recent_step_runs.py +0 -0
  106. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/reject_invite_request.py +0 -0
  107. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/replay_event_request.py +0 -0
  108. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/replay_workflow_runs_request.py +0 -0
  109. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/replay_workflow_runs_response.py +0 -0
  110. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/rerun_step_run_request.py +0 -0
  111. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/schedule_workflow_run_request.py +0 -0
  112. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/scheduled_run_status.py +0 -0
  113. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/scheduled_workflows.py +0 -0
  114. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/scheduled_workflows_list.py +0 -0
  115. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/scheduled_workflows_method.py +0 -0
  116. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/scheduled_workflows_order_by_field.py +0 -0
  117. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/semaphore_slots.py +0 -0
  118. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/slack_webhook.py +0 -0
  119. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/sns_integration.py +0 -0
  120. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/step.py +0 -0
  121. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/step_run.py +0 -0
  122. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/step_run_archive.py +0 -0
  123. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/step_run_archive_list.py +0 -0
  124. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/step_run_diff.py +0 -0
  125. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/step_run_event.py +0 -0
  126. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/step_run_event_list.py +0 -0
  127. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/step_run_event_reason.py +0 -0
  128. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/step_run_event_severity.py +0 -0
  129. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/step_run_status.py +0 -0
  130. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant.py +0 -0
  131. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_alert_email_group.py +0 -0
  132. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_alert_email_group_list.py +0 -0
  133. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_alerting_settings.py +0 -0
  134. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_invite.py +0 -0
  135. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_invite_list.py +0 -0
  136. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_list.py +0 -0
  137. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_member.py +0 -0
  138. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_member_list.py +0 -0
  139. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_member_role.py +0 -0
  140. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_queue_metrics.py +0 -0
  141. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_resource.py +0 -0
  142. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_resource_limit.py +0 -0
  143. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_resource_policy.py +0 -0
  144. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/tenant_step_run_queue_metrics.py +0 -0
  145. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/trigger_workflow_run_request.py +0 -0
  146. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/update_tenant_alert_email_group_request.py +0 -0
  147. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/update_tenant_invite_request.py +0 -0
  148. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/update_tenant_request.py +0 -0
  149. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/update_worker_request.py +0 -0
  150. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/user.py +0 -0
  151. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/user_change_password_request.py +0 -0
  152. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/user_login_request.py +0 -0
  153. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/user_register_request.py +0 -0
  154. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/user_tenant_memberships_list.py +0 -0
  155. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/user_tenant_public.py +0 -0
  156. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/webhook_worker.py +0 -0
  157. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/webhook_worker_create_request.py +0 -0
  158. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/webhook_worker_create_response.py +0 -0
  159. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/webhook_worker_created.py +0 -0
  160. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/webhook_worker_list_response.py +0 -0
  161. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/webhook_worker_request.py +0 -0
  162. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/webhook_worker_request_list_response.py +0 -0
  163. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/webhook_worker_request_method.py +0 -0
  164. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/worker.py +0 -0
  165. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/worker_label.py +0 -0
  166. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/worker_list.py +0 -0
  167. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/worker_runtime_info.py +0 -0
  168. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/worker_runtime_sdks.py +0 -0
  169. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/worker_type.py +0 -0
  170. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow.py +0 -0
  171. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_concurrency.py +0 -0
  172. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_deployment_config.py +0 -0
  173. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_kind.py +0 -0
  174. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_list.py +0 -0
  175. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_metrics.py +0 -0
  176. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_run.py +0 -0
  177. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_run_cancel200_response.py +0 -0
  178. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_run_list.py +0 -0
  179. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_run_order_by_direction.py +0 -0
  180. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_run_order_by_field.py +0 -0
  181. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_run_shape.py +0 -0
  182. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_run_status.py +0 -0
  183. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_run_triggered_by.py +0 -0
  184. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_runs_cancel_request.py +0 -0
  185. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_runs_metrics.py +0 -0
  186. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_runs_metrics_counts.py +0 -0
  187. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_tag.py +0 -0
  188. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_trigger_cron_ref.py +0 -0
  189. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_trigger_event_ref.py +0 -0
  190. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_triggers.py +0 -0
  191. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_update_request.py +0 -0
  192. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_version.py +0 -0
  193. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_version_concurrency.py +0 -0
  194. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_version_definition.py +0 -0
  195. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_version_meta.py +0 -0
  196. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/models/workflow_workers_count.py +0 -0
  197. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/rest.py +0 -0
  198. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest/tenacity_utils.py +0 -0
  199. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/rest_client.py +0 -0
  200. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/clients/run_event_listener.py +0 -0
  201. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/connection.py +0 -0
  202. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/context/__init__.py +0 -0
  203. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/context/worker_context.py +0 -0
  204. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/contracts/dispatcher_pb2.py +0 -0
  205. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/contracts/dispatcher_pb2.pyi +0 -0
  206. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/contracts/dispatcher_pb2_grpc.py +0 -0
  207. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/contracts/events_pb2.py +0 -0
  208. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/contracts/events_pb2.pyi +0 -0
  209. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/contracts/events_pb2_grpc.py +0 -0
  210. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/contracts/workflows_pb2.py +0 -0
  211. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/contracts/workflows_pb2.pyi +0 -0
  212. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/contracts/workflows_pb2_grpc.py +0 -0
  213. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/features/cron.py +0 -0
  214. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/features/scheduled.py +0 -0
  215. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/hatchet.py +0 -0
  216. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/labels.py +0 -0
  217. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/logger.py +0 -0
  218. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/metadata.py +0 -0
  219. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/py.typed +0 -0
  220. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/rate_limit.py +0 -0
  221. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/semver.py +0 -0
  222. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/token.py +0 -0
  223. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/utils/backoff.py +0 -0
  224. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/utils/serialization.py +0 -0
  225. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/utils/types.py +0 -0
  226. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/utils/typing.py +0 -0
  227. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/v2/callable.py +0 -0
  228. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/v2/concurrency.py +0 -0
  229. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/v2/hatchet.py +0 -0
  230. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/worker/__init__.py +0 -0
  231. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/worker/action_listener_process.py +0 -0
  232. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/worker/runner/run_loop_manager.py +0 -0
  233. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/worker/runner/utils/capture_logs.py +0 -0
  234. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/worker/runner/utils/error_with_traceback.py +0 -0
  235. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/worker/worker.py +0 -0
  236. {hatchet_sdk-0.46.1 → hatchet_sdk-0.47.0}/hatchet_sdk/workflow.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hatchet-sdk
3
- Version: 0.46.1
3
+ Version: 0.47.0
4
4
  Summary:
5
5
  Author: Alexander Belanger
6
6
  Author-email: alexander@hatchet.run
@@ -13,7 +13,7 @@ Provides-Extra: otel
13
13
  Requires-Dist: aiohttp (>=3.10.5,<4.0.0)
14
14
  Requires-Dist: aiohttp-retry (>=2.8.3,<3.0.0)
15
15
  Requires-Dist: aiostream (>=0.5.2,<0.6.0)
16
- Requires-Dist: cel-python (>=0.1.5,<0.2.0)
16
+ Requires-Dist: cel-python (>=0.2.0,<0.3.0)
17
17
  Requires-Dist: grpcio (>=1.64.1,!=1.68.*) ; python_version < "3.13"
18
18
  Requires-Dist: grpcio (>=1.69.0) ; python_version >= "3.13"
19
19
  Requires-Dist: grpcio-tools (>=1.64.1,!=1.68.*) ; python_version < "3.13"
@@ -75,6 +75,12 @@ class PooledWorkflowRunListener:
75
75
  interrupter: asyncio.Task = None
76
76
 
77
77
  def __init__(self, config: ClientConfig):
78
+ try:
79
+ asyncio.get_running_loop()
80
+ except RuntimeError:
81
+ loop = asyncio.new_event_loop()
82
+ asyncio.set_event_loop(loop)
83
+
78
84
  conn = new_conn(config, True)
79
85
  self.client = DispatcherStub(conn)
80
86
  self.token = config.token
@@ -260,12 +266,10 @@ class PooledWorkflowRunListener:
260
266
  if self.curr_requester != 0:
261
267
  self.requests.put_nowait(self.curr_requester)
262
268
 
263
- listener = self.client.SubscribeToWorkflowRuns(
269
+ return self.client.SubscribeToWorkflowRuns(
264
270
  self._request(),
265
271
  metadata=get_metadata(self.token),
266
272
  )
267
-
268
- return listener
269
273
  except grpc.RpcError as e:
270
274
  if e.code() == grpc.StatusCode.UNAVAILABLE:
271
275
  retries = retries + 1
@@ -403,3 +403,44 @@ class Context(BaseContext):
403
403
  for step_run in job_run.step_runs
404
404
  if step_run.error and step_run.step
405
405
  ]
406
+
407
+ @tenacity_retry
408
+ def spawn_workflow(
409
+ self,
410
+ workflow_name: str,
411
+ input: dict[str, Any] = {},
412
+ key: str | None = None,
413
+ options: ChildTriggerWorkflowOptions | None = None,
414
+ ) -> WorkflowRunRef:
415
+ worker_id = self.worker.id()
416
+ trigger_options = self._prepare_workflow_options(key, options, worker_id)
417
+
418
+ return self.admin_client.run_workflow(workflow_name, input, trigger_options)
419
+
420
+ @tenacity_retry
421
+ def spawn_workflows(
422
+ self, child_workflow_runs: list[ChildWorkflowRunDict]
423
+ ) -> list[WorkflowRunRef]:
424
+
425
+ if len(child_workflow_runs) == 0:
426
+ raise Exception("no child workflows to spawn")
427
+
428
+ worker_id = self.worker.id()
429
+
430
+ bulk_trigger_workflow_runs: list[WorkflowRunDict] = []
431
+ for child_workflow_run in child_workflow_runs:
432
+ workflow_name = child_workflow_run["workflow_name"]
433
+ input = child_workflow_run["input"]
434
+
435
+ key = child_workflow_run.get("key")
436
+ options = child_workflow_run.get("options", {})
437
+
438
+ trigger_options = self._prepare_workflow_options(key, options, worker_id)
439
+
440
+ bulk_trigger_workflow_runs.append(
441
+ WorkflowRunDict(
442
+ workflow_name=workflow_name, input=input, options=trigger_options
443
+ )
444
+ )
445
+
446
+ return self.admin_client.run_workflows(bulk_trigger_workflow_runs)
@@ -42,6 +42,7 @@ class ClientConfig:
42
42
  worker_healthcheck_port: int | None = None,
43
43
  worker_healthcheck_enabled: bool | None = None,
44
44
  worker_preset_labels: dict[str, str] = {},
45
+ enable_force_kill_sync_threads: bool = False,
45
46
  ):
46
47
  self.tenant_id = tenant_id
47
48
  self.tls_config = tls_config
@@ -55,6 +56,7 @@ class ClientConfig:
55
56
  self.worker_healthcheck_port = worker_healthcheck_port
56
57
  self.worker_healthcheck_enabled = worker_healthcheck_enabled
57
58
  self.worker_preset_labels = worker_preset_labels
59
+ self.enable_force_kill_sync_threads = enable_force_kill_sync_threads
58
60
 
59
61
  if not self.logInterceptor:
60
62
  self.logInterceptor = getLogger()
@@ -174,6 +176,14 @@ class ConfigLoader:
174
176
  "The `otel_exporter_otlp_*` fields are no longer supported as of SDK version `0.46.0`. Please see the documentation on OpenTelemetry at https://docs.hatchet.run/home/features/opentelemetry for more information on how to migrate to the new `HatchetInstrumentor`."
175
177
  )
176
178
 
179
+ enable_force_kill_sync_threads = bool(
180
+ get_config_value(
181
+ "enable_force_kill_sync_threads",
182
+ "HATCHET_CLIENT_ENABLE_FORCE_KILL_SYNC_THREADS",
183
+ )
184
+ == "True"
185
+ or False
186
+ )
177
187
  return ClientConfig(
178
188
  tenant_id=tenant_id,
179
189
  tls_config=tls_config,
@@ -188,6 +198,7 @@ class ConfigLoader:
188
198
  worker_healthcheck_port=worker_healthcheck_port,
189
199
  worker_healthcheck_enabled=worker_healthcheck_enabled,
190
200
  worker_preset_labels=worker_preset_labels,
201
+ enable_force_kill_sync_threads=enable_force_kill_sync_threads,
191
202
  )
192
203
 
193
204
  def _load_tls_config(self, tls_data: Dict, host_port) -> ClientTLSConfig:
@@ -13,6 +13,7 @@ try:
13
13
  StatusCode,
14
14
  TracerProvider,
15
15
  get_tracer,
16
+ get_tracer_provider,
16
17
  )
17
18
  from opentelemetry.trace.propagation.tracecontext import (
18
19
  TraceContextTextMapPropagator,
@@ -43,49 +44,121 @@ hatchet_sdk_version = version("hatchet-sdk")
43
44
 
44
45
  InstrumentKwargs = TracerProvider | MeterProvider | None
45
46
 
47
+ OTEL_TRACEPARENT_KEY = "traceparent"
46
48
 
47
- class HatchetInstrumentor(BaseInstrumentor): # type: ignore[misc]
48
- OTEL_TRACEPARENT_KEY = "traceparent"
49
49
 
50
- def __init__(
51
- self,
52
- tracer_provider: TracerProvider,
53
- meter_provider: MeterProvider = NoOpMeterProvider(),
54
- ):
55
- self.tracer_provider = tracer_provider
56
- self.meter_provider = meter_provider
50
+ def create_traceparent() -> str | None:
51
+ """
52
+ Creates and returns a W3C traceparent header value using OpenTelemetry's context propagation.
57
53
 
58
- super().__init__()
54
+ The traceparent header is used to propagate context information across service boundaries
55
+ in distributed tracing systems. It follows the W3C Trace Context specification.
59
56
 
60
- def create_traceparent(self) -> str | None:
61
- carrier: dict[str, str] = {}
62
- TraceContextTextMapPropagator().inject(carrier)
57
+ :returns: A W3C-formatted traceparent header value if successful, None if the context
58
+ injection fails or no active span exists.\n
59
+ Example: `00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01`
60
+ :rtype: str | None:
61
+ """
63
62
 
64
- return carrier.get("traceparent")
63
+ carrier: dict[str, str] = {}
64
+ TraceContextTextMapPropagator().inject(carrier)
65
65
 
66
- def parse_carrier_from_metadata(
67
- self, metadata: dict[str, str] | None
68
- ) -> Context | None:
69
- if not metadata:
70
- return None
66
+ return carrier.get("traceparent")
71
67
 
72
- traceparent = metadata.get(self.OTEL_TRACEPARENT_KEY)
73
68
 
74
- if not traceparent:
75
- return None
69
+ def parse_carrier_from_metadata(metadata: dict[str, str] | None) -> Context | None:
70
+ """
71
+ Parses OpenTelemetry trace context from a metadata dictionary.
76
72
 
77
- return TraceContextTextMapPropagator().extract(
78
- {self.OTEL_TRACEPARENT_KEY: traceparent}
79
- )
73
+ Extracts the trace context from metadata using the W3C Trace Context format,
74
+ specifically looking for the `traceparent` header.
75
+
76
+ :param metadata: A dictionary containing metadata key-value pairs,
77
+ potentially including the `traceparent` header. Can be None.
78
+ :type metadata: dict[str, str] | None
79
+ :returns: The extracted OpenTelemetry Context object if a valid `traceparent`
80
+ is found in the metadata, otherwise None.
81
+ :rtype: Context | None
82
+
83
+ :Example:
84
+
85
+ >>> metadata = {"traceparent": "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"}
86
+ >>> context = parse_carrier_from_metadata(metadata)
87
+ """
88
+
89
+ if not metadata:
90
+ return None
91
+
92
+ traceparent = metadata.get(OTEL_TRACEPARENT_KEY)
93
+
94
+ if not traceparent:
95
+ return None
96
+
97
+ return TraceContextTextMapPropagator().extract({OTEL_TRACEPARENT_KEY: traceparent})
98
+
99
+
100
+ def inject_traceparent_into_metadata(
101
+ metadata: dict[str, str], traceparent: str | None = None
102
+ ) -> dict[str, str]:
103
+ """
104
+ Injects OpenTelemetry `traceparent` into a metadata dictionary.
105
+
106
+ Takes a metadata dictionary and an optional `traceparent` string,
107
+ returning a new metadata dictionary with the `traceparent` added under the
108
+ `OTEL_TRACEPARENT_KEY`. If no `traceparent` is provided, it attempts to create one.
80
109
 
81
- def inject_traceparent_into_metadata(
82
- self, metadata: dict[str, str], traceparent: str | None
83
- ) -> dict[str, str]:
84
- if traceparent:
85
- metadata[self.OTEL_TRACEPARENT_KEY] = traceparent
110
+ :param metadata: The metadata dictionary to inject the `traceparent` into.
111
+ :type metadata: dict[str, str]
112
+ :param traceparent: The `traceparent` string to inject. If None, attempts to use
113
+ the current span.
114
+ :type traceparent: str | None, optional
115
+ :returns: A new metadata dictionary containing the original metadata plus
116
+ the injected `traceparent`, if one was available or could be created.
117
+ :rtype: dict[str, str]
86
118
 
119
+ :Example:
120
+
121
+ >>> metadata = {"key": "value"}
122
+ >>> new_metadata = inject_traceparent(metadata, "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01")
123
+ >>> print(new_metadata)
124
+ {"key": "value", "traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"}
125
+ """
126
+
127
+ if not traceparent:
128
+ traceparent = create_traceparent()
129
+
130
+ if not traceparent:
87
131
  return metadata
88
132
 
133
+ return {
134
+ **metadata,
135
+ OTEL_TRACEPARENT_KEY: traceparent,
136
+ }
137
+
138
+
139
+ class HatchetInstrumentor(BaseInstrumentor): # type: ignore[misc]
140
+ def __init__(
141
+ self,
142
+ tracer_provider: TracerProvider | None = None,
143
+ meter_provider: MeterProvider | None = None,
144
+ ):
145
+ """
146
+ Hatchet OpenTelemetry instrumentor.
147
+
148
+ The instrumentor provides an OpenTelemetry integration for Hatchet by setting up
149
+ tracing and metrics collection.
150
+
151
+ :param tracer_provider: TracerProvider | None: The OpenTelemetry TracerProvider to use.
152
+ If not provided, the global tracer provider will be used.
153
+ :param meter_provider: MeterProvider | None: The OpenTelemetry MeterProvider to use.
154
+ If not provided, a no-op meter provider will be used.
155
+ """
156
+
157
+ self.tracer_provider = tracer_provider or get_tracer_provider()
158
+ self.meter_provider = meter_provider or NoOpMeterProvider()
159
+
160
+ super().__init__()
161
+
89
162
  def instrumentation_dependencies(self) -> Collection[str]:
90
163
  return tuple()
91
164
 
@@ -154,7 +227,7 @@ class HatchetInstrumentor(BaseInstrumentor): # type: ignore[misc]
154
227
  kwargs: Any,
155
228
  ) -> Exception | None:
156
229
  action = args[0]
157
- traceparent = self.parse_carrier_from_metadata(action.additional_metadata)
230
+ traceparent = parse_carrier_from_metadata(action.additional_metadata)
158
231
 
159
232
  with self._tracer.start_as_current_span(
160
233
  "hatchet.start_step_run",
@@ -92,7 +92,7 @@ class EventLoopThread:
92
92
  self.loop = asyncio.new_event_loop()
93
93
  self.thread = Thread(target=self.run_loop_in_thread, args=(self.loop,))
94
94
 
95
- def __enter__(self) -> asyncio.AbstractEventLoop:
95
+ def __enter__(self, *a, **kw) -> asyncio.AbstractEventLoop:
96
96
  """
97
97
  Starts the thread running the event loop when entering the context.
98
98
 
@@ -102,7 +102,7 @@ class EventLoopThread:
102
102
  self.thread.start()
103
103
  return self.loop
104
104
 
105
- def __exit__(self) -> None:
105
+ def __exit__(self, *a, **kw) -> None:
106
106
  """
107
107
  Stops the event loop and joins the thread when exiting the context.
108
108
  """
@@ -3,12 +3,13 @@ import contextvars
3
3
  import ctypes
4
4
  import functools
5
5
  import json
6
+ import time
6
7
  import traceback
7
8
  from concurrent.futures import ThreadPoolExecutor
8
9
  from enum import Enum
9
10
  from multiprocessing import Queue
10
11
  from threading import Thread, current_thread
11
- from typing import Any, Callable, Dict, Literal, Type, TypeVar, cast, overload
12
+ from typing import Any, Callable, Dict, cast
12
13
 
13
14
  from pydantic import BaseModel
14
15
 
@@ -421,6 +422,11 @@ class Runner:
421
422
 
422
423
  # check if thread is still running, if so, print a warning
423
424
  if run_id in self.threads:
425
+ thread = self.threads.get(run_id)
426
+ if thread and self.client.config.enable_force_kill_sync_threads:
427
+ self.force_kill_thread(thread)
428
+ await asyncio.sleep(1)
429
+
424
430
  logger.warning(
425
431
  f"Thread {self.threads[run_id].ident} with run id {run_id} is still running after cancellation. This could cause the thread pool to get blocked and prevent new tasks from running."
426
432
  )
@@ -32,16 +32,18 @@ class WorkflowRunRef:
32
32
  return self.workflow_listener.result(self.workflow_run_id)
33
33
 
34
34
  def sync_result(self) -> dict:
35
+ coro = self.workflow_listener.result(self.workflow_run_id)
35
36
  loop = get_active_event_loop()
37
+
36
38
  if loop is None:
37
- with EventLoopThread() as loop:
38
- coro = self.workflow_listener.result(self.workflow_run_id)
39
- future = asyncio.run_coroutine_threadsafe(coro, loop)
40
- return future.result()
39
+ loop = asyncio.new_event_loop()
40
+ asyncio.set_event_loop(loop)
41
+ try:
42
+ return loop.run_until_complete(coro)
43
+ finally:
44
+ asyncio.set_event_loop(None)
41
45
  else:
42
- coro = self.workflow_listener.result(self.workflow_run_id)
43
- future = asyncio.run_coroutine_threadsafe(coro, loop)
44
- return future.result()
46
+ return loop.run_until_complete(coro)
45
47
 
46
48
 
47
49
  T = TypeVar("T")
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "hatchet-sdk"
3
- version = "0.46.1"
3
+ version = "0.47.0"
4
4
  description = ""
5
5
  authors = ["Alexander Belanger <alexander@hatchet.run>"]
6
6
  readme = "README.md"
@@ -27,7 +27,7 @@ nest-asyncio = "^1.6.0"
27
27
  aiohttp = "^3.10.5"
28
28
  aiohttp-retry = "^2.8.3"
29
29
  tenacity = ">=8.4.1"
30
- cel-python = "^0.1.5"
30
+ cel-python = "^0.2.0"
31
31
  opentelemetry-api = { version = "^1.28.0", optional = true }
32
32
  opentelemetry-sdk = { version = "^1.28.0", optional = true }
33
33
  opentelemetry-instrumentation = { version = ">=0.49b0", optional = true }
@@ -111,6 +111,7 @@ explicit_package_bases = true
111
111
  api = "examples.api.api:main"
112
112
  async = "examples.async.worker:main"
113
113
  fanout = "examples.fanout.worker:main"
114
+ fanout_sync = "examples.fanout_sync.worker:main"
114
115
  cancellation = "examples.cancellation.worker:main"
115
116
  concurrency_limit = "examples.concurrency_limit.worker:main"
116
117
  concurrency_limit_rr = "examples.concurrency_limit_rr.worker:main"
File without changes