From 71fcce8bfcaea222e4aca0b7ee90e30751533b50 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Wed, 10 Jul 2024 14:12:18 +0100 Subject: [PATCH] Don't use class attributes for mutable workflow state (#509) --- features/update/basic/feature.py | 3 ++- features/update/self/feature.py | 3 ++- features/update/task_failure/feature.py | 3 ++- features/update/validation_replay/feature.py | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/features/update/basic/feature.py b/features/update/basic/feature.py index 8a2f2650..dcd41f33 100644 --- a/features/update/basic/feature.py +++ b/features/update/basic/feature.py @@ -9,7 +9,8 @@ @workflow.defn class Workflow: - am_done = False + def __init__(self) -> None: + self.am_done = False @workflow.run async def run(self) -> str: diff --git a/features/update/self/feature.py b/features/update/self/feature.py index 8fbacfa0..95d22978 100644 --- a/features/update/self/feature.py +++ b/features/update/self/feature.py @@ -9,7 +9,8 @@ @workflow.defn class Workflow: - am_done = False + def __init__(self) -> None: + self.am_done = False @workflow.run async def run(self) -> str: diff --git a/features/update/task_failure/feature.py b/features/update/task_failure/feature.py index 736e353c..a596683f 100644 --- a/features/update/task_failure/feature.py +++ b/features/update/task_failure/feature.py @@ -12,7 +12,8 @@ @workflow.defn class Workflow: - am_done = False + def __init__(self) -> None: + self.am_done = False @workflow.run async def run(self) -> str: diff --git a/features/update/validation_replay/feature.py b/features/update/validation_replay/feature.py index 34309aba..f44063f6 100644 --- a/features/update/validation_replay/feature.py +++ b/features/update/validation_replay/feature.py @@ -13,7 +13,8 @@ @workflow.defn class Workflow: - am_done = False + def __init__(self) -> None: + self.am_done = False @workflow.run async def run(self) -> str: