azure-functions-python-worker
azure-functions-python-worker copied to clipboard
fix: enable missed return types for generic
Description
Implicit output is now enabled for generic bindings, so the worker needs to support returning the same python types as it did when implicit output wasn't enabled. The other types that have been returned include:
- dict
- list
- int
- double
- bool
TypedData only supports string, json, bytes, stream, http, int, double, collection types, and model_binding_data. Therefore, types that are not supported (dict, list, bool), are converted to supported types (json, json, int respectively).
Added E2E tests for all supported return types to check if the functions are executing correctly and unit tests to test the return values.
Fixes #
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.
Codecov Report
Attention: Patch coverage is 0% with 20 lines in your changes are missing coverage. Please review.
Project coverage is 44.55%. Comparing base (
cd13c6a) to head (8359a44). Report is 1 commits behind head on dev.
:exclamation: Current head 8359a44 differs from pull request most recent head 419d951
Please upload reports for the commit 419d951 to get more accurate results.
| Files | Patch % | Lines |
|---|---|---|
| azure_functions_worker/bindings/datumdef.py | 0.00% | 10 Missing :warning: |
| azure_functions_worker/bindings/generic.py | 0.00% | 10 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## dev #1485 +/- ##
===========================================
+ Coverage 31.65% 44.55% +12.90%
===========================================
Files 36 36
Lines 2306 2325 +19
Branches 336 346 +10
===========================================
+ Hits 730 1036 +306
+ Misses 1574 1206 -368
- Partials 2 83 +81
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 44.55% <0.00%> (+12.90%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.