Wrong return type on create_timer()
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
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
🐛 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:
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
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/azure-functions-durable-python
-
Enhancement fixed-in-v2 P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/azure-functions-durable-python#617 · 1 comment ·
-
Custom object serialization broken for orchestrator return valuesPossibly taken @andystaples claimed this 65 days ago. Openbug fixed-in-v2 P2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Azure/azure-functions-durable-python#568 · 1 comment ·
-
bug fixed-in-v2 P3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Azure/azure-functions-durable-python#475 · 1 comment ·
-
Enhancement fixed-in-v2 P3
Difficulty 4/5 3-5 days Newbie friendliness 62/100
Azure/azure-functions-durable-python#618 · 1 comment ·
-
blocked bug fixed-in-v2 known-regression
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Azure/azure-functions-durable-python#600 · 3 comments ·
All issues in Azure/azure-functions-durable-python
Similar issues
-
json_params_matcher fails on falsy top-level JSON primitives (0, False, "")Possibly taken @mayureshsonawane17 claimed this today. OpenWaiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
bojieli/ai-agent-book#1169 ·
Maintainers usually reply within 1 day
-
priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenHands/extensions#738 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
micronaut-projects/micronaut-core#13677 ·
Maintainers usually reply within 1 day