Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad logging/error handling #170

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test_cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on: # yamllint disable-line rule:truthy
push:
branches:
- '*_cloud'
workflow_dispatch:

jobs:
cloud_tests:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
- '3.11'
clickhouse-version:
- '22.8'
- '23.2'
- '23.3'
- '23.4'
- '23.5'
- '23.6'
- latest

steps:
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
### Release [1.4.4], 2023-07-19
#### Bug Fixes
- Fixed two logging/exception handling issues that would cause exception on startup or when handling some exceptions
from the ClickHouse server. Partially addresses https://github.com/ClickHouse/dbt-clickhouse/issues/169.
- Fixed issue with the `on_cluster` macro that would break the exchange tables step of incremental materializations
with an active cluster. Thanks to [Andrew Davis](https://github.com/Savid) for the PR. Closes
https://github.com/ClickHouse/dbt-clickhouse/issues/167

### Release [1.4.3], 2023-06-27
#### Bug Fix
- Use correct return value for `execute`. This would cause an exception when running hooks. Thanks to
[Sergey Reshetnikov](https://github.com/PrVrSs) for the PR. Closed https://github.com/ClickHouse/dbt-clickhouse/issues/161

#### Improvement
- Added macros for creating distributed tables. See the `distributed_table.sql` include file. Thanks to
[gladkikhtutu](https://github.com/gladkikhtutu) for the contribution.

### Release [1.4.2], 2023-05-14
#### Bug fixes
- Create initial dbt database (if not found) on the defined cluster on first run, instead of just the execution node.
Thanks to [Jens Hoevenaars](https://github.com/codenation-nl) for the PR
- Fix the SYSTEM SYNC REPLICA statement when exchanging tables ON CLUSTER for incremental materializations. Thanks to
[Schum](https://github.com/Schum-io) for PR. Closed https://github.com/ClickHouse/dbt-clickhouse/issues/157.

### Release [1.4.1], 2023-05-11
#### Improvements
- Reduce the number of SQL calls for Modify Comment operations. Thanks to [Konstantin Ilchenko](https://github.com/simpl1g).
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/clickhouse/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '1.4.3'
version = '1.4.4'
2 changes: 1 addition & 1 deletion dbt/adapters/clickhouse/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def exception_handler(self, sql):
logger.debug('Error running SQL: {}', sql)
if isinstance(exp, dbt.exceptions.DbtRuntimeError):
raise
raise dbt.exceptions.DbtRuntimeError from exp
raise dbt.exceptions.DbtRuntimeError('ClickHouse exception: ' + str(exp)) from exp

@classmethod
def open(cls, connection):
Expand Down
4 changes: 2 additions & 2 deletions dbt/adapters/clickhouse/dbclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _check_atomic_exchange(self) -> bool:
for table in swap_tables:
self.command(f'DROP TABLE IF EXISTS {table}')
except DbtDatabaseError:
logger.info('Unexpected server exception dropping table', exc_info=True)
logger.info('Unexpected server exception dropping table')
except DbtDatabaseError:
logger.warning('Failed to run exchange test', exc_info=True)
logger.warning('Failed to run exchange test')
return False