From 8f0bb1f65ef752840d9235308a6b94368b0e3ebd Mon Sep 17 00:00:00 2001 From: auxten Date: Mon, 28 Oct 2024 18:51:49 +0800 Subject: [PATCH] Fix lint issues --- dbt/adapters/clickhouse/chdbclient.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dbt/adapters/clickhouse/chdbclient.py b/dbt/adapters/clickhouse/chdbclient.py index 406d43ea..a74fddd9 100644 --- a/dbt/adapters/clickhouse/chdbclient.py +++ b/dbt/adapters/clickhouse/chdbclient.py @@ -30,7 +30,9 @@ def query(self, sql, **kwargs): result.read() return result except CHDBResultError as ex: - raise DbtDatabaseError(f"reading result from chdb query using json failed: {str(ex).strip()}") from ex + raise DbtDatabaseError( + f"reading result from chdb query using json failed: {str(ex).strip()}" + ) from ex except ChdbError as ex: raise DbtDatabaseError(f"chdb query failed with exception: {str(ex).strip()}") from ex except Exception as ex: @@ -49,7 +51,6 @@ def command(self, sql, **kwargs): except Exception as ex: raise DbtDatabaseError(f"chdb command failed with exception: {str(ex).strip()}") from ex - def columns_in_query(self, sql: str, **kwargs) -> List[ClickHouseColumn]: try: query_result = self._client.query( @@ -61,7 +62,9 @@ def columns_in_query(self, sql: str, **kwargs) -> List[ClickHouseColumn]: for name, ch_type in zip(query_result.column_names, query_result.column_types) ] except ChdbError as ex: - raise DbtDatabaseError(f"chdb columns_in_query failed with exception: {str(ex).strip()}") from ex + raise DbtDatabaseError( + f"chdb columns_in_query failed with exception: {str(ex).strip()}" + ) from ex except Exception as ex: raise DbtDatabaseError(str(ex).strip()) from ex @@ -107,7 +110,9 @@ def _create_client(self, credentials: ClickHouseCredentials): try: client.query(sql_content) except ChdbError as ex: - raise DbtDatabaseError(f"client creation failed with exception: {str(ex).strip()}") from ex + raise DbtDatabaseError( + f"client creation failed with exception: {str(ex).strip()}" + ) from ex return client def _set_client_database(self):