azure-functions-python-worker
azure-functions-python-worker copied to clipboard
fix: added optional context param for tasks
Description
Python 3.11+ introduced a context
parameter that can be passed when creating a task. This change enables the ContextEnabledTask
class to accept this parameter. Since the param is only available for 3.11+, there is a conditional check inside the ContextEnabledTask`` init()
method to send the param based on python version.
Added tests for creating a task with context (3.11+), creating a task without context (all versions), and creating a ContextEnabledTask
.
Fixes https://github.com/Azure/azure-functions-python-worker/issues/1508
PR information
- [ ] The title of the PR is clear and informative.
- [ ] There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
- [ ] If applicable, the PR references the bug/issue that it fixes in the description.
- [ ] New Unit tests were added for the changes made and CI is passing.
Quality of Code and Contribution Guidelines
- [ ] I have read the contribution guidelines.