🐛 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:
|
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
🐛 Describe the bug
Type hint for return value of
create_timer()isTaskBase, but that does not contain thecancel()function.ReturningTimerTaskseems more appropiate.Edit: See comment below on why
TimerTaskmight not be a viable type anywayCurrent source:
azure-functions-durable-python/azure/durable_functions/models/DurableOrchestrationContext.py
Line 601 in 4ab004b
Example code:
🤔 Expected behavior
You should be able to call
cancel()without linter/type checker errors.☕ Steps to reproduce
See above