Skip to content

Commit

Permalink
Fix bad logging/error handling (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
genzgd authored Jul 19, 2023
1 parent 67cf9db commit c3cad11
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 6 deletions.
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

0 comments on commit c3cad11

Please sign in to comment.