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):