Skip to content

Commit c3a1dd5

Browse files
committed
Allow azure functions to take in List[EventHubEvent] (#31)
* Allow azure functions to take in List[EventHubEvent] * Only accept List[_eventhub.EventHubEvent]
1 parent d5e1019 commit c3a1dd5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

azure/functions/eventhub.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ class EventHubConverter(meta.InConverter, meta.OutConverter,
1111

1212
@classmethod
1313
def check_input_type_annotation(cls, pytype: type) -> bool:
14-
return issubclass(pytype, _eventhub.EventHubEvent)
14+
return (
15+
issubclass(pytype, _eventhub.EventHubEvent)
16+
or (issubclass(pytype, typing.List)
17+
and issubclass(pytype.__args__[0], _eventhub.EventHubEvent))
18+
)
1519

1620
@classmethod
1721
def check_output_type_annotation(cls, pytype) -> bool:

0 commit comments

Comments
 (0)