Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: recognize collection_model_binding_data for batch inputs #1655

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

EvanR-Dev
Copy link
Contributor

@EvanR-Dev EvanR-Dev commented Mar 18, 2025

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 for collection_model_binding_data in the datumdef.py and meta.py files, and updating the defaultExecutablePath in the worker configuration file.

Enhancements to data handling:

Configuration updates:

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:

version: "1.0"source: "AzureEventHubsEventData"content_type: "application/octet-stream"content: "\000Sr\301\216\010\243\033x-opt-sequence-number-epochT\377\243\025x-opt-sequence-numberU.\243\014x-opt-offset\201\000\000\000\001\000\000\030\020\243\023x-opt-enqueued-time\000\243\035com.microsoft:datetime-offset\201\010\335c/`\215c\220\000St\301I\002\241\rDiagnostic-Id\241700-2b9c74c8f8a49fcdee7743b26534811a-891cfa411389e551-00\000Su\240 {\"message\": \"Hello from local!\"}"

collection_model_binding_data:

model_binding_data {
  version: "1.0"
  source: "AzureEventHubsEventData"
  content_type: "application/octet-stream"
  content: "\000Sr\301\216\010\243\033x-opt-sequence-number-epochT\377\243\025x-opt-sequence-numberUH\243\014x-opt-offset\201\000\000\000\003\000\000\006\340\243\023x-opt-enqueued-time\000\243\035com.microsoft:datetime-offset\201\010\335e\266\360\233G\300\000St\301I\002\241\rDiagnostic-Id\241700-a6e861768b42bdbaa26e5e367c8b0ffa-d71a437aea587458-00\000Su\240 {\"message\": \"Hello from local!\"}"
}
model_binding_data {
  version: "1.0"
  source: "AzureEventHubsEventData"
  content_type: "application/octet-stream"
  content: "\000Sr\301\216\010\243\033x-opt-sequence-number-epochT\377\243\025x-opt-sequence-numberUI\243\014x-opt-offset\201\000\000\000\003\000\000\007\220\243\023x-opt-enqueued-time\000\243\035com.microsoft:datetime-offset\201\010\335e\266\360\233G\300\000St\301I\002\241\rDiagnostic-Id\241700-a6e861768b42bdbaa26e5e367c8b0ffa-d71a437aea587458-00\000Su\240 {\"message\": \"Hello from local!\"}"
}

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

  • 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

Evan Roman added 2 commits March 17, 2025 23:22
@EvanR-Dev EvanR-Dev changed the title Recognize collection_model_binding_data for batch inputs build: recognize collection_model_binding_data for batch inputs Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant