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

Null input binding throws an exception #548

Closed
jeffhollan opened this issue Sep 18, 2019 · 5 comments · Fixed by Azure/azure-functions-python-library#28
Closed

Null input binding throws an exception #548

jeffhollan opened this issue Sep 18, 2019 · 5 comments · Fixed by Azure/azure-functions-python-library#28
Assignees

Comments

@jeffhollan
Copy link

When attempting to use an input binding to something like CosmosDB, if the input binding is empty (e.g. referencing an ID that isn't there), the function throws right away (with an error about not able to convert NoneType to func.Document or str or whatever). However, with other languages like JavaScript, the function still executes, the input binding is just null. This prevents doing things like gracefully handling a null input binding and returning an error.

https://stackoverflow.com/questions/57979944/azure-function-written-in-python-has-500-when-id-binding-points-doesnt-have-a

@tiptop96
Copy link

Any idea on how to get started on fixing this? Do we know what code is causing this?

@jeffhollan
Copy link
Author

Yes @maiqbal11 mentioned yesterday there is some validation code somewhere that we would remove to prevent this check which isn’t necessary

@maiqbal11
Copy link
Contributor

We decode the data from Cosmos but right now we aren't checking for the case where the data in None: https://github.com/Azure/azure-functions-python-library/blob/edce123f18b2b45d0d18c0bccd6e934290af0dee/azure/functions/cosmosdb.py#L24. Will add a fix shortly.

@aarsan
Copy link

aarsan commented Oct 9, 2019

Running into this problem as well

@Hazhzeng
Copy link
Contributor

The fix has been merged to the python library, it will go with the next 1.0.5 release.

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 a pull request may close this issue.

6 participants