-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Labels
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.
Current source:
azure-functions-durable-python/azure/durable_functions/models/DurableOrchestrationContext.py
Line 601 in 4ab004b
| def create_timer(self, fire_at: datetime.datetime) -> TaskBase: |
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
tamir-deep