From d2cf2893e3f962ba923a4b1c86ee0a5c7d5ffa5a Mon Sep 17 00:00:00 2001 From: Akshaya Annavajhala Date: Sat, 4 May 2024 04:23:28 +0000 Subject: [PATCH 1/2] only serialize failure details if they exist Signed-off-by: Akshaya Annavajhala --- .../dapr/ext/workflow/workflow_state.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_state.py b/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_state.py index d93a3c01..10847fc5 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_state.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/workflow_state.py @@ -60,7 +60,7 @@ def __str__(self) -> str: return json.dumps(self.to_json(), indent=4, sort_keys=True, default=str) def to_json(self): - return { + state_dict = { 'instance_id': self.__obj.instance_id, 'name': self.__obj.name, 'runtime_status': self.__obj.runtime_status.name, @@ -69,9 +69,11 @@ def to_json(self): 'serialized_input': self.__obj.serialized_input, 'serialized_output': self.__obj.serialized_output, 'serialized_custom_status': self.__obj.serialized_custom_status, - 'failure_details': { + } + if self.__obj.failure_details is not None: + state_dict['failure_details'] = { 'message': self.__obj.failure_details.message, 'error_type': self.__obj.failure_details.error_type, 'stack_trace': self.__obj.failure_details.stack_trace, - }, - } + } + return state_dict From c5323f12c5934a4125dfe544e044ea5437809ddd Mon Sep 17 00:00:00 2001 From: Bernd Verst Date: Wed, 15 May 2024 19:06:17 -0700 Subject: [PATCH 2/2] Pin workflow SDK 0.4.1 in example (#715) * Pin workflow SDK 0.4.1 in example Signed-off-by: Bernd Verst * fix workflow dev version Signed-off-by: Bernd Verst * fix workflow example dependency Signed-off-by: Bernd Verst --------- Signed-off-by: Bernd Verst Signed-off-by: Akshaya Annavajhala --- examples/workflow/requirements.txt | 3 ++- ext/dapr-ext-workflow/dapr/ext/workflow/version.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/workflow/requirements.txt b/examples/workflow/requirements.txt index b7f8da74..6a748d0e 100644 --- a/examples/workflow/requirements.txt +++ b/examples/workflow/requirements.txt @@ -1 +1,2 @@ -dapr-ext-workflow>=0.1.0 +dapr-ext-workflow-dev>=0.4.1rc1.dev +dapr-dev>=1.13.0rc1.dev diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/version.py b/ext/dapr-ext-workflow/dapr/ext/workflow/version.py index 37933993..581cb696 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/version.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/version.py @@ -13,4 +13,4 @@ limitations under the License. """ -__version__ = '0.4.0rc1.dev' +__version__ = '0.4.1rc1.dev'