Azure / azure-functions-python-worker

Python worker for Azure Functions.
http://aka.ms/azurefunctions
MIT License
333 stars 103 forks source link

[BUG] Table output binding does not work as documented #1235

Closed obesser closed 1 year ago

obesser commented 1 year ago

Investigative information

azure-functions-1.14.0 Core Tools Version: 4.0.5095 Commit hash: N/A (64-bit) Function Runtime Version: 4.16.5.20396

Repro steps

  1. Run this example:

https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-table-output?tabs=in-process%2Cstorage-extension&pivots=programming-language-python#example

Expected behavior

A new entity with properties as defined in the data object in the example.

Actual behavior

An error is raised: System.Private.CoreLib: Exception while executing function: Functions.HttpTrigger1. Microsoft.Azure.WebJobs.Extensions.Tables: '' is not a valid value for a partition key or row key.

So, it seems partitionKey and rowKey are expected in the binding definition.

When using both rowKey and partitionKey, a new entity is added to the table with these keys, but with the following additional unrequested properties: Length, LongLength, Rank, SyncRoot, IsReadOnly, IsFixedSize, IsSynchronized (looks like .NET array properties?) while the properties in the payload (the data object) are completely ignored, i.e there is no Name property.

pdthummar commented 1 year ago

@obesser Thanks for reporting the issue. This is known issue https://github.com/Azure/azure-sdk-for-net/issues/33902. It will be taken care by extension host side. Thanks

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

obesser commented 1 year ago

@pdthummar The issue you referenced is closed as fixed on the extension side. What does it mean for the Python worker, when does it use an updated extension version?

pdthummar commented 1 year ago

@obesser Issue is fixed on the extension side. I have tried to replicate the issue. It is working as expected. I would suggest try with latest Coretools version and ensure that you are using "version": "[3.*, 4.0.0)" in host.json. Thanks

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.