hatchet-sdk 1.2.5__py3-none-any.whl → 1.2.6__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/runnables/workflow.py +25 -14
- {hatchet_sdk-1.2.5.dist-info → hatchet_sdk-1.2.6.dist-info}/METADATA +1 -1
- {hatchet_sdk-1.2.5.dist-info → hatchet_sdk-1.2.6.dist-info}/RECORD +5 -5
- {hatchet_sdk-1.2.5.dist-info → hatchet_sdk-1.2.6.dist-info}/WHEEL +0 -0
- {hatchet_sdk-1.2.5.dist-info → hatchet_sdk-1.2.6.dist-info}/entry_points.txt +0 -0
|
@@ -284,11 +284,22 @@ class BaseWorkflow(Generic[TWorkflowInput]):
|
|
|
284
284
|
) -> WorkflowRunTriggerConfig:
|
|
285
285
|
return WorkflowRunTriggerConfig(
|
|
286
286
|
workflow_name=self.config.name,
|
|
287
|
-
input=
|
|
287
|
+
input=self._serialize_input(input),
|
|
288
288
|
options=options,
|
|
289
289
|
key=key,
|
|
290
290
|
)
|
|
291
291
|
|
|
292
|
+
def _serialize_input(self, input: TWorkflowInput | None) -> JSONSerializableMapping:
|
|
293
|
+
if not input:
|
|
294
|
+
return {}
|
|
295
|
+
|
|
296
|
+
if isinstance(input, BaseModel):
|
|
297
|
+
return input.model_dump(mode="json")
|
|
298
|
+
|
|
299
|
+
raise ValueError(
|
|
300
|
+
f"Input must be a BaseModel or `None`, got {type(input)} instead."
|
|
301
|
+
)
|
|
302
|
+
|
|
292
303
|
|
|
293
304
|
class Workflow(BaseWorkflow[TWorkflowInput]):
|
|
294
305
|
"""
|
|
@@ -303,7 +314,7 @@ class Workflow(BaseWorkflow[TWorkflowInput]):
|
|
|
303
314
|
) -> WorkflowRunRef:
|
|
304
315
|
return self.client._client.admin.run_workflow(
|
|
305
316
|
workflow_name=self.config.name,
|
|
306
|
-
input=
|
|
317
|
+
input=self._serialize_input(input),
|
|
307
318
|
options=options,
|
|
308
319
|
)
|
|
309
320
|
|
|
@@ -314,7 +325,7 @@ class Workflow(BaseWorkflow[TWorkflowInput]):
|
|
|
314
325
|
) -> dict[str, Any]:
|
|
315
326
|
ref = self.client._client.admin.run_workflow(
|
|
316
327
|
workflow_name=self.config.name,
|
|
317
|
-
input=
|
|
328
|
+
input=self._serialize_input(input),
|
|
318
329
|
options=options,
|
|
319
330
|
)
|
|
320
331
|
|
|
@@ -327,7 +338,7 @@ class Workflow(BaseWorkflow[TWorkflowInput]):
|
|
|
327
338
|
) -> WorkflowRunRef:
|
|
328
339
|
return await self.client._client.admin.aio_run_workflow(
|
|
329
340
|
workflow_name=self.config.name,
|
|
330
|
-
input=
|
|
341
|
+
input=self._serialize_input(input),
|
|
331
342
|
options=options,
|
|
332
343
|
)
|
|
333
344
|
|
|
@@ -338,7 +349,7 @@ class Workflow(BaseWorkflow[TWorkflowInput]):
|
|
|
338
349
|
) -> dict[str, Any]:
|
|
339
350
|
ref = await self.client._client.admin.aio_run_workflow(
|
|
340
351
|
workflow_name=self.config.name,
|
|
341
|
-
input=
|
|
352
|
+
input=self._serialize_input(input),
|
|
342
353
|
options=options,
|
|
343
354
|
)
|
|
344
355
|
|
|
@@ -389,20 +400,20 @@ class Workflow(BaseWorkflow[TWorkflowInput]):
|
|
|
389
400
|
return self.client._client.admin.schedule_workflow(
|
|
390
401
|
name=self.config.name,
|
|
391
402
|
schedules=cast(list[datetime | timestamp_pb2.Timestamp], [run_at]),
|
|
392
|
-
input=
|
|
403
|
+
input=self._serialize_input(input),
|
|
393
404
|
options=options,
|
|
394
405
|
)
|
|
395
406
|
|
|
396
407
|
async def aio_schedule(
|
|
397
408
|
self,
|
|
398
409
|
run_at: datetime,
|
|
399
|
-
input: TWorkflowInput,
|
|
410
|
+
input: TWorkflowInput | None = None,
|
|
400
411
|
options: ScheduleTriggerWorkflowOptions = ScheduleTriggerWorkflowOptions(),
|
|
401
412
|
) -> WorkflowVersion:
|
|
402
413
|
return await self.client._client.admin.aio_schedule_workflow(
|
|
403
414
|
name=self.config.name,
|
|
404
415
|
schedules=cast(list[datetime | timestamp_pb2.Timestamp], [run_at]),
|
|
405
|
-
input=
|
|
416
|
+
input=self._serialize_input(input),
|
|
406
417
|
options=options,
|
|
407
418
|
)
|
|
408
419
|
|
|
@@ -410,14 +421,14 @@ class Workflow(BaseWorkflow[TWorkflowInput]):
|
|
|
410
421
|
self,
|
|
411
422
|
cron_name: str,
|
|
412
423
|
expression: str,
|
|
413
|
-
input: TWorkflowInput,
|
|
414
|
-
additional_metadata: JSONSerializableMapping,
|
|
424
|
+
input: TWorkflowInput | None = None,
|
|
425
|
+
additional_metadata: JSONSerializableMapping = {},
|
|
415
426
|
) -> CronWorkflows:
|
|
416
427
|
return self.client.cron.create(
|
|
417
428
|
workflow_name=self.config.name,
|
|
418
429
|
cron_name=cron_name,
|
|
419
430
|
expression=expression,
|
|
420
|
-
input=
|
|
431
|
+
input=self._serialize_input(input),
|
|
421
432
|
additional_metadata=additional_metadata,
|
|
422
433
|
)
|
|
423
434
|
|
|
@@ -425,14 +436,14 @@ class Workflow(BaseWorkflow[TWorkflowInput]):
|
|
|
425
436
|
self,
|
|
426
437
|
cron_name: str,
|
|
427
438
|
expression: str,
|
|
428
|
-
input: TWorkflowInput,
|
|
429
|
-
additional_metadata: JSONSerializableMapping,
|
|
439
|
+
input: TWorkflowInput | None = None,
|
|
440
|
+
additional_metadata: JSONSerializableMapping = {},
|
|
430
441
|
) -> CronWorkflows:
|
|
431
442
|
return await self.client.cron.aio_create(
|
|
432
443
|
workflow_name=self.config.name,
|
|
433
444
|
cron_name=cron_name,
|
|
434
445
|
expression=expression,
|
|
435
|
-
input=
|
|
446
|
+
input=self._serialize_input(input),
|
|
436
447
|
additional_metadata=additional_metadata,
|
|
437
448
|
)
|
|
438
449
|
|
|
@@ -260,7 +260,7 @@ hatchet_sdk/runnables/contextvars.py,sha256=6MDocAMmlyiRW37oQ1jyx10tAlJs-xgDjR3x
|
|
|
260
260
|
hatchet_sdk/runnables/standalone.py,sha256=Qcg1oc7NlTw2ZCqq5D869fhssKBLUaZKUwDo4UVcVm4,6128
|
|
261
261
|
hatchet_sdk/runnables/task.py,sha256=jQiRPeE9EbIzNOxv6hkmJ8RqyVR7hMLXX4cnGRl_GF8,4832
|
|
262
262
|
hatchet_sdk/runnables/types.py,sha256=JWo4hkYb2XYoktIFVvnqud6Ywmo7AHMK_upYpdNmij0,4235
|
|
263
|
-
hatchet_sdk/runnables/workflow.py,sha256=
|
|
263
|
+
hatchet_sdk/runnables/workflow.py,sha256=677DIWOErlVkIwJ2VeNwRAg7wkCUpOt_Av3wy3N2HcA,31090
|
|
264
264
|
hatchet_sdk/token.py,sha256=KjIiInwG5Kqd_FO4BSW1x_5Uc7PFbnzIVJqr50-ZldE,779
|
|
265
265
|
hatchet_sdk/utils/aio.py,sha256=A9pKNn8eAKUeinY2uBkJn4jdrYI5vAw_A-gzz04xdvQ,1122
|
|
266
266
|
hatchet_sdk/utils/backoff.py,sha256=6B5Rb5nLKw_TqqgpJMYjIBV1PTTtbOMRZCveisVhg_I,353
|
|
@@ -506,7 +506,7 @@ hatchet_sdk/worker/runner/runner.py,sha256=ZocvR7dDgEvSxcHAWDDaoTasSz3Wio70TbEbB
|
|
|
506
506
|
hatchet_sdk/worker/runner/utils/capture_logs.py,sha256=nHRPSiDBqzhObM7i2X7t03OupVFnE7kQBdR2Ckgg-2w,2709
|
|
507
507
|
hatchet_sdk/worker/worker.py,sha256=qyHs64H-grF9HR1CgH7MlnoDmTQ8mm4d8basx-ZDyWc,14490
|
|
508
508
|
hatchet_sdk/workflow_run.py,sha256=Q1nTpnWNsFfjWWpx49xXYUHsVbqTnHL6JWnSKoFM3_I,1029
|
|
509
|
-
hatchet_sdk-1.2.
|
|
510
|
-
hatchet_sdk-1.2.
|
|
511
|
-
hatchet_sdk-1.2.
|
|
512
|
-
hatchet_sdk-1.2.
|
|
509
|
+
hatchet_sdk-1.2.6.dist-info/METADATA,sha256=LfptC1FhJwxcjLrYm_Qc1EIQ6Yx6Gsqhc7msQrwYP6s,3571
|
|
510
|
+
hatchet_sdk-1.2.6.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
511
|
+
hatchet_sdk-1.2.6.dist-info/entry_points.txt,sha256=5mTp_AsCWK5raiVxP_MU9eBCgkRGl4OsN6chpHcvm7o,1235
|
|
512
|
+
hatchet_sdk-1.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|