From 78a4969ae1bace6a89fde0855cd04843d043a209 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:25:56 -0800 Subject: [PATCH] lint --- .../provider/utils/websockets/client.py | 10 +++++----- .../provider/utils/websockets/database.py | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/openbb_platform/core/openbb_core/provider/utils/websockets/client.py b/openbb_platform/core/openbb_core/provider/utils/websockets/client.py index 35accd184b9..1fecc2096eb 100644 --- a/openbb_platform/core/openbb_core/provider/utils/websockets/client.py +++ b/openbb_platform/core/openbb_core/provider/utils/websockets/client.py @@ -181,7 +181,7 @@ class WebSocketClient: # pylint: disable=too-many-instance-attributes except Exception as e: # pylint: disable=broad-except msg = ( "Unexpected error setting up the SQLite database and table ->" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__} -> {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) self._exception = OpenBBError(msg) @@ -570,7 +570,7 @@ class WebSocketClient: # pylint: disable=too-many-instance-attributes except Exception as e: # pylint: disable=broad-except msg = ( "Error clearing results:" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__} -> {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) @@ -800,7 +800,7 @@ def non_blocking_websocket(client, output_queue, provider_message_queue) -> None except Exception as e: # pylint: disable=broad-except msg = ( "Unexpected error in non_blocking_websocket:" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__} -> {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) client.logger.error(msg) raise e from e @@ -834,7 +834,7 @@ def send_message( except Exception as e: # pylint: disable=broad-except msg = ( f"Error sending message to the {target} process:" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__} -> {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) client.logger.error(msg) @@ -877,7 +877,7 @@ def non_blocking_broadcast(client, output_queue, broadcast_message_queue) -> Non except Exception as e: # pylint: disable=broad-except err = ( f"Unexpected error in non_blocking_broadcast:" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__} -> {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) client.logger.error(err) finally: diff --git a/openbb_platform/core/openbb_core/provider/utils/websockets/database.py b/openbb_platform/core/openbb_core/provider/utils/websockets/database.py index 19968f88e68..4f3552218c3 100644 --- a/openbb_platform/core/openbb_core/provider/utils/websockets/database.py +++ b/openbb_platform/core/openbb_core/provider/utils/websockets/database.py @@ -88,7 +88,7 @@ class Database: self.results_file = temp_file_path elif results_file and "://" in results_file: self.results_file = results_file - self.results_path = results_file + self.results_path = results_file # type: ignore kwargs["uri"] = True else: self.results_path = Path(results_file).absolute() @@ -144,10 +144,10 @@ class Database: except Exception as e: msg = ( "Unexpected error while creating SQLite database ->" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__}: {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) - self._exception = e + self._exception = e # type: ignore raise OpenBBError(msg) from e async def _write_to_db(self, message) -> None: @@ -224,7 +224,7 @@ class Database: except Exception as e: # pylint: disable=broad-except msg = ( "Unexpected error while writing to SQLite database ->" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__}: {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) self._exception = e @@ -278,10 +278,10 @@ class Database: except Exception as e: msg = ( "Unexpected error while deserializing row -> " - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__}: {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) - self._exception = e + self._exception = e # type: ignore raise OpenBBError(msg) from e def fetch_all(self, limit: Optional[int] = None) -> list: @@ -291,7 +291,7 @@ class Database: except Exception as e: msg = ( "Unexpected error while reading from SQLite database ->" - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__}: {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) self._exception = e @@ -414,7 +414,7 @@ class Database: except Exception as e: # pylint: disable=broad-except msg = ( "Error clearing results: " - f" {e.__class__.__name__ if hasattr(e, '__class__') else e.__name__}: {e}" + f" {e.__class__.__name__ if hasattr(e, '__class__') else e} -> {e.args}" ) self.logger.error(msg) raise OpenBBError(msg) from e