Skip to content

Commit b08bd77

Browse files
committed
Support unannotated elementary bindings
1 parent 807a656 commit b08bd77

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

azure/functions_worker/functions.py

+5
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ def add_function(self, function_id: str,
224224
f'type of {param.name} binding in function.json '
225225
f'"{desc.type}" does not match its Python '
226226
f'annotation "{param_py_type.__name__}"')
227+
else:
228+
if desc.data_type is protos.BindingInfo.string:
229+
param_py_type = str
230+
elif desc.data_type is protos.BindingInfo.binary:
231+
param_py_type = bytes
227232

228233
param_type_info = ParamTypeInfo(param_bind_type, param_py_type)
229234
if is_binding_out:

tests/queue_functions/queue_trigger_untyped/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
logger = logging.getLogger(__name__)
55

66

7-
def main(msg: str) -> str:
7+
def main(msg) -> str:
88
return msg

0 commit comments

Comments
 (0)