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

hatchet_sdk/config.py CHANGED
@@ -84,6 +84,7 @@ class ClientConfig(BaseSettings):
84
84
 
85
85
  terminate_worker_after_num_tasks: int | None = None
86
86
  disable_log_capture: bool = False
87
+ log_queue_size: int = 1000
87
88
  grpc_enable_fork_support: bool = False
88
89
 
89
90
  @model_validator(mode="after")
@@ -1406,6 +1406,7 @@ class Standalone(BaseWorkflow[TWorkflowInput], Generic[TWorkflowInput, R]):
1406
1406
  parent_outputs: dict[str, JSONSerializableMapping] | None = None,
1407
1407
  retry_count: int = 0,
1408
1408
  lifespan: Any = None,
1409
+ dependencies: dict[str, Any] | None = None,
1409
1410
  ) -> R:
1410
1411
  """
1411
1412
  Mimic the execution of a task. This method is intended to be used to unit test
@@ -1417,6 +1418,7 @@ class Standalone(BaseWorkflow[TWorkflowInput], Generic[TWorkflowInput, R]):
1417
1418
  :param parent_outputs: Outputs from parent tasks, if any. This is useful for mimicking DAG functionality. For instance, if you have a task `step_2` that has a `parent` which is `step_1`, you can pass `parent_outputs={"step_1": {"result": "Hello, world!"}}` to `step_2.mock_run()` to be able to access `ctx.task_output(step_1)` in `step_2`.
1418
1419
  :param retry_count: The number of times the task has been retried.
1419
1420
  :param lifespan: The lifespan to be used in the task, which is useful if one was set on the worker. This will allow you to access `ctx.lifespan` inside of your task.
1421
+ :param dependencies: Dependencies to be injected into the task. This is useful for tasks that have dependencies defined using `Depends`. **IMPORTANT**: You must pass the dependencies _directly_, **not** the `Depends` objects themselves. For example, if you have a task that has a dependency `config: Annotated[str, Depends(get_config)]`, you should pass `dependencies={"config": "config_value"}` to `aio_mock_run`.
1420
1422
 
1421
1423
  :return: The output of the task.
1422
1424
  """
@@ -1427,6 +1429,7 @@ class Standalone(BaseWorkflow[TWorkflowInput], Generic[TWorkflowInput, R]):
1427
1429
  parent_outputs=parent_outputs,
1428
1430
  retry_count=retry_count,
1429
1431
  lifespan=lifespan,
1432
+ dependencies=dependencies,
1430
1433
  )
1431
1434
 
1432
1435
  async def aio_mock_run(
@@ -1436,6 +1439,7 @@ class Standalone(BaseWorkflow[TWorkflowInput], Generic[TWorkflowInput, R]):
1436
1439
  parent_outputs: dict[str, JSONSerializableMapping] | None = None,
1437
1440
  retry_count: int = 0,
1438
1441
  lifespan: Any = None,
1442
+ dependencies: dict[str, Any] | None = None,
1439
1443
  ) -> R:
1440
1444
  """
1441
1445
  Mimic the execution of a task. This method is intended to be used to unit test
@@ -1447,6 +1451,7 @@ class Standalone(BaseWorkflow[TWorkflowInput], Generic[TWorkflowInput, R]):
1447
1451
  :param parent_outputs: Outputs from parent tasks, if any. This is useful for mimicking DAG functionality. For instance, if you have a task `step_2` that has a `parent` which is `step_1`, you can pass `parent_outputs={"step_1": {"result": "Hello, world!"}}` to `step_2.mock_run()` to be able to access `ctx.task_output(step_1)` in `step_2`.
1448
1452
  :param retry_count: The number of times the task has been retried.
1449
1453
  :param lifespan: The lifespan to be used in the task, which is useful if one was set on the worker. This will allow you to access `ctx.lifespan` inside of your task.
1454
+ :param dependencies: Dependencies to be injected into the task. This is useful for tasks that have dependencies defined using `Depends`. **IMPORTANT**: You must pass the dependencies _directly_, **not** the `Depends` objects themselves. For example, if you have a task that has a dependency `config: Annotated[str, Depends(get_config)]`, you should pass `dependencies={"config": "config_value"}` to `aio_mock_run`.
1450
1455
 
1451
1456
  :return: The output of the task.
1452
1457
  """
@@ -1457,6 +1462,7 @@ class Standalone(BaseWorkflow[TWorkflowInput], Generic[TWorkflowInput, R]):
1457
1462
  parent_outputs=parent_outputs,
1458
1463
  retry_count=retry_count,
1459
1464
  lifespan=lifespan,
1465
+ dependencies=dependencies,
1460
1466
  )
1461
1467
 
1462
1468
  @property
@@ -78,7 +78,9 @@ class LogRecord(BaseModel):
78
78
  class AsyncLogSender:
79
79
  def __init__(self, event_client: EventClient):
80
80
  self.event_client = event_client
81
- self.q = asyncio.Queue[LogRecord | STOP_LOOP_TYPE](maxsize=1000)
81
+ self.q = asyncio.Queue[LogRecord | STOP_LOOP_TYPE](
82
+ maxsize=event_client.client_config.log_queue_size
83
+ )
82
84
 
83
85
  async def consume(self) -> None:
84
86
  while True:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hatchet-sdk
3
- Version: 1.17.0
3
+ Version: 1.17.2
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Alexander Belanger
@@ -12,9 +12,9 @@ Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
14
  Provides-Extra: otel
15
+ Provides-Extra: v0
15
16
  Requires-Dist: aiohttp (>=3.10.5,<4.0.0)
16
- Requires-Dist: aiohttp-retry (>=2.8.3,<3.0.0)
17
- Requires-Dist: aiostream (>=0.5.2,<0.6.0)
17
+ Requires-Dist: cel-python (>=0.4.0,<0.5.0) ; extra == "v0"
18
18
  Requires-Dist: grpcio (>=1.64.1,!=1.68.*) ; python_version < "3.13"
19
19
  Requires-Dist: grpcio (>=1.69.0) ; python_version >= "3.13"
20
20
  Requires-Dist: grpcio-tools (>=1.64.1,!=1.68.*) ; python_version < "3.13"
@@ -258,7 +258,7 @@ hatchet_sdk/clients/rest/rest.py,sha256=zZHTzgl-NBdcK6XhG23m_s9RKRONGPPItzGe407s
258
258
  hatchet_sdk/clients/rest/tenacity_utils.py,sha256=WeNt_1ah2-NKB9qTI3JnTjItpSviBV95U0cPM4kB5as,1211
259
259
  hatchet_sdk/clients/v1/api_client.py,sha256=vUaQr7Xi71a2kFHkZy-pB3tCg3-t0ROlqbPUQA6skIA,2013
260
260
  hatchet_sdk/conditions.py,sha256=CnhpkXgVXM3wc0kAX8KZQA6tp8NFAbdzAN2xFbw7Hb0,4522
261
- hatchet_sdk/config.py,sha256=9yXDCBfVW5AHosiSRWiEScSFSsm7Lx7wi0urNLC11Ck,5266
261
+ hatchet_sdk/config.py,sha256=4tYuNXuzHAhapNveNA4DYpvtQERDoefrIn0qfwImqkc,5297
262
262
  hatchet_sdk/connection.py,sha256=XCBY9-UxaN3blakgZ59AhDpjb1ilLOOlmNNM6QaDtMM,2961
263
263
  hatchet_sdk/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
264
264
  hatchet_sdk/context/context.py,sha256=KE-GsaosBar8USXSj1lkWHdsZXfXFf6tI9RwGTOF-aM,16278
@@ -304,7 +304,7 @@ hatchet_sdk/runnables/action.py,sha256=zrVHpyzIQ9XZgWwY69b_6uhZd53An4trRoLd9b3os
304
304
  hatchet_sdk/runnables/contextvars.py,sha256=jHrrewUlFPAT9f2u3VCsuSlDBtBoagEUtUzJOSmm4yk,1118
305
305
  hatchet_sdk/runnables/task.py,sha256=JsiDBkYQVJodyqtNDT9z8Pwz3ePL8GhY0Z1-ptPw9ms,16030
306
306
  hatchet_sdk/runnables/types.py,sha256=M23xSMTBPl12CXCCXZ0wbnqZ_sePB6CJKtOdipiNDlg,4362
307
- hatchet_sdk/runnables/workflow.py,sha256=Nm71LrY_EcPJUrlzRuBh6sp7bv-pMrt0gQgZNftue9g,57848
307
+ hatchet_sdk/runnables/workflow.py,sha256=-oz0q76N-NAi3Xon1VXkzDvZe0ZjbXR_O-3sTCGfokk,58876
308
308
  hatchet_sdk/token.py,sha256=KjIiInwG5Kqd_FO4BSW1x_5Uc7PFbnzIVJqr50-ZldE,779
309
309
  hatchet_sdk/utils/aio.py,sha256=cu1rD_UZkShtfzi7iXMYwBBaCRdxJQTdUC0_mf8nU2E,499
310
310
  hatchet_sdk/utils/backoff.py,sha256=6B5Rb5nLKw_TqqgpJMYjIBV1PTTtbOMRZCveisVhg_I,353
@@ -539,10 +539,10 @@ hatchet_sdk/worker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
539
539
  hatchet_sdk/worker/action_listener_process.py,sha256=CzXen-7tFG_rryvM2xWV2_KMUFC2-i_Ts643TB_Urd8,12878
540
540
  hatchet_sdk/worker/runner/run_loop_manager.py,sha256=BcdfxSvZdrxbeTZSUASwCTMKJe6pwLorHVKPTprkM2k,4176
541
541
  hatchet_sdk/worker/runner/runner.py,sha256=QULD00hEyW2dcHCcH46C1k7mxr5nHEwtusyAs33VOO0,22857
542
- hatchet_sdk/worker/runner/utils/capture_logs.py,sha256=Gpzcs1JVqZE0spFztyjcbcUTjDCrdIBI9c_POVhSIvk,4616
542
+ hatchet_sdk/worker/runner/utils/capture_logs.py,sha256=hNELuNHS0HmoMZJ7F7yIjZuahPEx9cOx9JZro618W74,4675
543
543
  hatchet_sdk/worker/worker.py,sha256=9EiESMMcS7voa4cAnmnHMx4rC-pqaTmP74bcTbFPqfQ,16435
544
544
  hatchet_sdk/workflow_run.py,sha256=KcylcqRwKADtnzOTjoiVr1vdr7qTZFtDeD5aRS6A4Y8,2823
545
- hatchet_sdk-1.17.0.dist-info/METADATA,sha256=_ChzeGYdEXj9NRkokdcAU4aME768nOI09kILBnz2YUE,3585
546
- hatchet_sdk-1.17.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
547
- hatchet_sdk-1.17.0.dist-info/entry_points.txt,sha256=Un_76pcLse-ZGBlwebhQpnTPyQrripeHW8J7qmEpGOk,1400
548
- hatchet_sdk-1.17.0.dist-info/RECORD,,
545
+ hatchet_sdk-1.17.2.dist-info/METADATA,sha256=VjUqhyfWf1zjwywsLeGVT41CQJcda7YyTSMu1jA-NLM,3575
546
+ hatchet_sdk-1.17.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
547
+ hatchet_sdk-1.17.2.dist-info/entry_points.txt,sha256=Un_76pcLse-ZGBlwebhQpnTPyQrripeHW8J7qmEpGOk,1400
548
+ hatchet_sdk-1.17.2.dist-info/RECORD,,