From 6068dd82f665c378e147b8478e8c855417854e1f Mon Sep 17 00:00:00 2001 From: David Gardner Date: Mon, 18 Dec 2023 11:55:28 -0800 Subject: [PATCH] Rename import exception so as to not define a commonly used variable in the module scope --- morpheus/controllers/elasticsearch_controller.py | 4 ++-- morpheus/controllers/rss_controller.py | 4 ++-- morpheus/llm/services/nemo_llm_service.py | 4 ++-- morpheus/llm/services/openai_chat_service.py | 4 ++-- morpheus/service/vdb/milvus_vector_db_service.py | 4 ++-- morpheus/stages/input/databricks_deltalake_source_stage.py | 4 ++-- morpheus/stages/output/write_to_databricks_deltalake_stage.py | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/morpheus/controllers/elasticsearch_controller.py b/morpheus/controllers/elasticsearch_controller.py index 9d64be439c..361fde67ad 100644 --- a/morpheus/controllers/elasticsearch_controller.py +++ b/morpheus/controllers/elasticsearch_controller.py @@ -26,8 +26,8 @@ from elasticsearch import ConnectionError as ESConnectionError from elasticsearch import Elasticsearch from elasticsearch.helpers import parallel_bulk -except ImportError as exc: - IMPORT_EXCEPTION = exc +except ImportError as import_exc: + IMPORT_EXCEPTION = import_exc class ElasticsearchController: diff --git a/morpheus/controllers/rss_controller.py b/morpheus/controllers/rss_controller.py index 2bc3432d79..cafefa17c8 100644 --- a/morpheus/controllers/rss_controller.py +++ b/morpheus/controllers/rss_controller.py @@ -31,8 +31,8 @@ try: import feedparser from bs4 import BeautifulSoup -except ImportError as exc: - IMPORT_EXCEPTION = exc +except ImportError as import_exc: + IMPORT_EXCEPTION = import_exc @dataclass diff --git a/morpheus/llm/services/nemo_llm_service.py b/morpheus/llm/services/nemo_llm_service.py index dbd5f223d4..94385a2820 100644 --- a/morpheus/llm/services/nemo_llm_service.py +++ b/morpheus/llm/services/nemo_llm_service.py @@ -32,8 +32,8 @@ try: import nemollm -except ImportError as exc: - IMPORT_EXCEPTION = exc +except ImportError as import_exc: + IMPORT_EXCEPTION = import_exc class NeMoLLMClient(LLMClient): diff --git a/morpheus/llm/services/openai_chat_service.py b/morpheus/llm/services/openai_chat_service.py index dd0a2e11ea..f155393df3 100644 --- a/morpheus/llm/services/openai_chat_service.py +++ b/morpheus/llm/services/openai_chat_service.py @@ -33,8 +33,8 @@ try: import openai -except ImportError as exc: - IMPORT_EXCEPTION = exc +except ImportError as import_exc: + IMPORT_EXCEPTION = import_exc class OpenAIChatClient(LLMClient): diff --git a/morpheus/service/vdb/milvus_vector_db_service.py b/morpheus/service/vdb/milvus_vector_db_service.py index d6a2880cac..ab6c4c53ca 100644 --- a/morpheus/service/vdb/milvus_vector_db_service.py +++ b/morpheus/service/vdb/milvus_vector_db_service.py @@ -37,8 +37,8 @@ from pymilvus.orm.mutation import MutationResult from morpheus.service.vdb.milvus_client import MilvusClient # pylint: disable=ungrouped-imports -except ImportError as exc: - IMPORT_EXCEPTION = exc +except ImportError as import_exc: + IMPORT_EXCEPTION = import_exc class FieldSchemaEncoder(json.JSONEncoder): diff --git a/morpheus/stages/input/databricks_deltalake_source_stage.py b/morpheus/stages/input/databricks_deltalake_source_stage.py index ff9144eb6d..21cd2a0d23 100644 --- a/morpheus/stages/input/databricks_deltalake_source_stage.py +++ b/morpheus/stages/input/databricks_deltalake_source_stage.py @@ -34,8 +34,8 @@ from databricks.connect import DatabricksSession from pyspark.sql import functions as sf from pyspark.sql.window import Window -except ImportError as exc: - IMPORT_EXCEPTION = exc +except ImportError as import_exc: + IMPORT_EXCEPTION = import_exc @register_stage("from-databricks-deltalake") diff --git a/morpheus/stages/output/write_to_databricks_deltalake_stage.py b/morpheus/stages/output/write_to_databricks_deltalake_stage.py index 398714069e..385701797d 100644 --- a/morpheus/stages/output/write_to_databricks_deltalake_stage.py +++ b/morpheus/stages/output/write_to_databricks_deltalake_stage.py @@ -35,8 +35,8 @@ try: from databricks.connect import DatabricksSession from pyspark.sql import types as sql_types -except ImportError as exc: - IMPORT_EXCEPTION = exc +except ImportError as import_exc: + IMPORT_EXCEPTION = import_exc @register_stage("to-databricks-deltalake")