build: recognize collection_model_binding_data for batch inputs #1655
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to enhance the handling of
collection_model_binding_data
and updates the configuration for the Python worker executable path. The most important changes include adding support forcollection_model_binding_data
in thedatumdef.py
andmeta.py
files, and updating thedefaultExecutablePath
in the worker configuration file.Enhancements to data handling:
azure_functions_worker/bindings/datumdef.py
: Added support forcollection_model_binding_data
in thefrom_typed_data
method.azure_functions_worker/bindings/meta.py
: Modified thedeferred_bindings_decode
method to handlecollection_model_binding_data
by accumulating the content of eachmodel_binding_data
. [1] [2]Configuration updates:
python/test/worker.config.json
: Updated thedefaultExecutablePath
to point to the specific environment's Python executable.Description
Addresses https://github.com/Azure/azure-functions-pyfx-planning/issues/393
Today when a user uses a deferred binding, the host sends a model_binding_data object that is converted into its corresponding SDK type. This object contains important information about the SDK type, but most notably the content.
For triggers that can handle batch inputs such as EventHub, this means the cardinality="many" - in this case, the host sends us a collection_model_binding_data object, which is just 1 to N model_binding_data objects. Here is a sample for each:
model_binding_data:
collection_model_binding_data:
Notice that model_binding_data automatically has the fields accessible to do the conversion whereas collection_model_binding_data has each model_binding_data nested
PR information
Quality of Code and Contribution Guidelines