Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Wrong return type on create_timer()

Open Beginner friendly
#587 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
api

Research direction

Start at azure/durable_functions/models/DurableOrchestrationContext.py around line 601 and inspect the return annotation for create_timer(). Reproduce the example with Pylance, then verify that calling cancel() no longer produces a type-checking error and that the annotation accurately represents the returned timer task.

Written by the indexing model from the issue text.

Description

bug Debuggability fixed-in-v2 P2

🐛 Describe the bug
Type hint for return value of create_timer() is TaskBase, but that does not contain the cancel() function. Returning TimerTask seems more appropiate.

Edit: See comment below on why TimerTask might not be a viable type anyway

Current source:

https://github.com/Azure/azure-functions-durable-python/blob/4ab004b6bc994b0395ee965186f8402b86b7a887/azure/durable_functions/models/DurableOrchestrationContext.py#L601

Example code:

    expiration = context.current_utc_datetime + timedelta(seconds=20)
    timeout_task = context.create_timer(expiration)
    timeout_task.cancel()  # <-- Pylance shows error: "Cannot access attribute "cancel" for class "TaskBase""

🤔 Expected behavior
You should be able to call cancel()without linter/type checker errors.

☕ Steps to reproduce
See above

Dominant language
Python
Stars
157
Forks
70
Avg merge
46m
Merged PRs (30d)
1

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/azure-functions-durable-python

All issues in Azure/azure-functions-durable-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.