diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py b/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py index 23012cfb..b9865344 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/dapr_workflow_client.py @@ -108,7 +108,11 @@ def schedule_new_workflow( reuse_id_policy=reuse_id_policy, ) return self.__obj.schedule_new_orchestration( - workflow.__name__, input=input, instance_id=instance_id, start_at=start_at, reuse_id_policy=reuse_id_policy, + workflow.__name__, + input=input, + instance_id=instance_id, + start_at=start_at, + reuse_id_policy=reuse_id_policy, ) def get_workflow_state( @@ -214,7 +218,9 @@ def raise_workflow_event( """ return self.__obj.raise_orchestration_event(instance_id, event_name, data=data) - def terminate_workflow(self, instance_id: str, *, output: Optional[Any] = None, recursive: bool = True): + def terminate_workflow( + self, instance_id: str, *, output: Optional[Any] = None, recursive: bool = True + ): """Terminates a running workflow instance and updates its runtime status to WorkflowRuntimeStatus.Terminated This method internally enqueues a "terminate" message in the task hub. When the task hub worker processes this message, it will update the runtime diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_context.py b/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_context.py index 36674236..b4c85f6a 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_context.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_context.py @@ -86,8 +86,7 @@ def is_replaying(self) -> bool: @abstractmethod def set_custom_status(self, custom_status: str) -> None: - """Set the custom status. - """ + """Set the custom status.""" pass @abstractmethod diff --git a/ext/dapr-ext-workflow/tests/test_dapr_workflow_context.py b/ext/dapr-ext-workflow/tests/test_dapr_workflow_context.py index 6b3c9ad3..9fdfe044 100644 --- a/ext/dapr-ext-workflow/tests/test_dapr_workflow_context.py +++ b/ext/dapr-ext-workflow/tests/test_dapr_workflow_context.py @@ -25,11 +25,13 @@ mock_create_timer = 'create_timer' mock_call_activity = 'call_activity' mock_call_sub_orchestrator = 'call_sub_orchestrator' +mock_custom_status = 'custom_status' class FakeOrchestrationContext: def __init__(self): self.instance_id = mock_instance_id + self.custom_status = None def create_timer(self, fire_at): return mock_create_timer @@ -40,6 +42,9 @@ def call_activity(self, activity, input): def call_sub_orchestrator(self, orchestrator, input, instance_id): return mock_call_sub_orchestrator + def set_custom_status(self, custom_status): + self.custom_status = custom_status + class DaprWorkflowContextTest(unittest.TestCase): def mock_client_activity(ctx: WorkflowActivityContext, input): @@ -65,3 +70,6 @@ def test_workflow_context_functions(self): create_timer_result = dapr_wf_ctx.create_timer(mock_date_time) assert create_timer_result == mock_create_timer + + dapr_wf_ctx.set_custom_status(mock_custom_status) + assert fakeContext.custom_status == mock_custom_status diff --git a/setup.cfg b/setup.cfg index 87c00f36..740c3661 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,8 +26,8 @@ include_package_data = True zip_safe = False install_requires = protobuf >= 4.22 - grpcio >= 1.37.0 - grpcio-status>=1.37.0 + grpcio >= 1.67.0 + grpcio-status>=1.67.0 aiohttp >= 3.9.0b0 python-dateutil >= 2.8.1 typing-extensions>=4.4.0 diff --git a/tools/requirements.txt b/tools/requirements.txt index d3d503c9..e528d98b 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -1 +1 @@ -grpcio-tools>=1.57.0 +grpcio-tools>=1.67.0