Skip to content

Revert "Enabling implicit output for generic bindings (#1348)" #1376

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 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all 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 True
return False
14 changes: 7 additions & 7 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_implicit_output', [
'foobar_as_bytes_no_anno', [
protos.ParameterBinding(
name='input',
data=protos.TypedData(
Expand All @@ -140,10 +140,10 @@ async def test_mock_generic_should_not_support_implicit_output(self):
)
]
)
# It passes now as we are enabling generic binding to return output
# implicitly
# It should fail here, since generic binding requires
# $return statement in function.json to pass output
self.assertEqual(r.response.result.status,
protos.StatusResult.Success)
protos.StatusResult.Failure)

async def test_mock_generic_should_support_without_datatype(self):
async with testutils.start_mockhost(
Expand All @@ -166,7 +166,7 @@ async def test_mock_generic_should_support_without_datatype(self):
)
]
)
# It passes now as we are enabling generic binding to return output
# implicitly
# It should fail here, since the generic binding requires datatype
# to be defined in function.json
self.assertEqual(r.response.result.status,
protos.StatusResult.Success)
protos.StatusResult.Failure)