From 87c805fad1218bcf4d8444520ef959c75a6d5728 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Wed, 22 May 2024 13:10:03 -0400 Subject: [PATCH] Don't mutate class attribute - Comment out unused imports --- encryption/codec.py | 1 - hello/hello_activity.py | 4 ++-- hello/hello_mtls.py | 3 ++- hello/hello_patch.py | 4 ++-- hello/hello_search_attributes.py | 5 +---- hello/hello_update.py | 3 ++- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/encryption/codec.py b/encryption/codec.py index 6aaa58be..9f79526f 100644 --- a/encryption/codec.py +++ b/encryption/codec.py @@ -1,4 +1,3 @@ -import base64 import os from typing import Iterable, List diff --git a/hello/hello_activity.py b/hello/hello_activity.py index 6615b55d..9801ee1b 100644 --- a/hello/hello_activity.py +++ b/hello/hello_activity.py @@ -1,5 +1,4 @@ import asyncio -import logging from dataclasses import dataclass from datetime import timedelta @@ -38,7 +37,8 @@ async def run(self, name: str) -> str: async def main(): - # Uncomment the line below to see logging + # Uncomment the lines below to see logging output + # import logging # logging.basicConfig(level=logging.INFO) # Start client diff --git a/hello/hello_mtls.py b/hello/hello_mtls.py index f613fba4..1ac6f9d8 100644 --- a/hello/hello_mtls.py +++ b/hello/hello_mtls.py @@ -5,7 +5,8 @@ from typing import Optional from temporalio import activity, workflow -from temporalio.client import Client, TLSConfig +from temporalio.client import Client +from temporalio.service import TLSConfig from temporalio.worker import Worker diff --git a/hello/hello_patch.py b/hello/hello_patch.py index 43371d4f..0ed19b2f 100644 --- a/hello/hello_patch.py +++ b/hello/hello_patch.py @@ -1,5 +1,4 @@ import asyncio -import logging import sys from dataclasses import dataclass from datetime import timedelta @@ -96,7 +95,8 @@ async def main(): version = sys.argv[1] - # Uncomment the line below to see logging + # Uncomment the lines below to see logging output + # import logging # logging.basicConfig(level=logging.INFO) # Start client diff --git a/hello/hello_search_attributes.py b/hello/hello_search_attributes.py index 6892fb71..8b504ea6 100644 --- a/hello/hello_search_attributes.py +++ b/hello/hello_search_attributes.py @@ -1,10 +1,7 @@ import asyncio -from typing import List from temporalio import workflow -from temporalio.client import Client, WorkflowExecutionDescription -from temporalio.common import SearchAttributeValues -from temporalio.converter import default as default_converter +from temporalio.client import Client from temporalio.worker import Worker diff --git a/hello/hello_update.py b/hello/hello_update.py index 1b1236d3..111d95b1 100644 --- a/hello/hello_update.py +++ b/hello/hello_update.py @@ -7,7 +7,8 @@ @workflow.defn class GreetingWorkflow: - is_complete = False + def __init__(self): + self.is_complete = False @workflow.run async def run(self) -> str: