#4727·hatchet

[BUG] Python SDK: unable to disable task retries if any default is set

Author: lachtanekCreated Aug 18, 2026Updated Sep 29, 2026
Labelsgood first issuesdk-pyaccepted

Describe the issue When default retries are set using TaskDefaults(retries=3), you can't disable them for a specific task, as the @task decorator has retries=0 as default value (instead of None or some other sentinel value)

Environment

  • SDK: Python 1.37.2
  • Engine: irrelevant

Expected behavior You can disable retries on individual tasks

Code to Reproduce, Logs, or Screenshots In this example, no_retry_task will have retries=3

python
some_wf = hatchet.workflow(
	name="SomeWF",
    task_defaults=TaskDefaults(
        retries=3
    ),
)

@some_wf.task(retries=0)
def no_retry_task(...):
	...

Additional context The code handling defaults is here https://github.com/hatchet-dev/hatchet/blob/main/sdks/python/hatchet_sdk/runnables/workflow.py#L139-L143


AI Disclosure

This was written entirely by hand