Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
auxten committed Oct 28, 2024
1 parent 855440d commit 8f0bb1f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions dbt/adapters/clickhouse/chdbclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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(
Expand All @@ -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

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 8f0bb1f

Please sign in to comment.