Skip to content

DurableClient Converter #206

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
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
9 changes: 9 additions & 0 deletions azure/functions/durable_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,12 @@ def encode(cls, obj: typing.Any, *,
@classmethod
def has_implicit_output(cls) -> bool:
return True


# Durable Function Activity Trigger
class DurableClientConverter(meta.InConverter,
meta.OutConverter,
binding='durableClient'):
@classmethod
def has_implicit_output(cls) -> bool:
return False
8 changes: 7 additions & 1 deletion tests/test_durable_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from azure.functions.durable_functions import (
OrchestrationTriggerConverter,
EnitityTriggerConverter,
ActivityTriggerConverter
ActivityTriggerConverter,
DurableClientConverter
)
from azure.functions._durable_functions import (
OrchestrationContext,
Expand Down Expand Up @@ -213,6 +214,11 @@ def test_activity_trigger_has_implicit_return(self):
ActivityTriggerConverter.has_implicit_output()
)

def test_durable_client_no_implicit_return(self):
self.assertFalse(
DurableClientConverter.has_implicit_output()
)

def test_enitity_trigger_check_output_type_annotation(self):
self.assertTrue(
EnitityTriggerConverter.check_output_type_annotation(pytype=None)
Expand Down