Skip to content

Enabling implicit output for generic bindings #1348

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

Merged
merged 7 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure_functions_worker/bindings/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ def decode(cls, data: datumdef.Datum, *, trigger_metadata) -> typing.Any:

@classmethod
def has_implicit_output(cls) -> bool:
return False
return True
6 changes: 3 additions & 3 deletions tests/unittests/test_mock_generic_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async def test_mock_generic_should_not_support_implicit_output(self):
protos.StatusResult.Success)

_, r = await host.invoke_function(
'foobar_as_bytes_no_anno', [
'foobar_implicit_output', [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just fixing the incorrect test

protos.ParameterBinding(
name='input',
data=protos.TypedData(
Expand All @@ -143,7 +143,7 @@ async def test_mock_generic_should_not_support_implicit_output(self):
# It should fail here, since generic binding requires
# $return statement in function.json to pass output
self.assertEqual(r.response.result.status,
protos.StatusResult.Failure)
protos.StatusResult.Success)

async def test_mock_generic_should_support_without_datatype(self):
async with testutils.start_mockhost(
Expand All @@ -169,4 +169,4 @@ async def test_mock_generic_should_support_without_datatype(self):
# It should fail here, since the generic binding requires datatype
# to be defined in function.json
self.assertEqual(r.response.result.status,
protos.StatusResult.Failure)
protos.StatusResult.Success)