Skip to content

Commit

Permalink
Merge pull request #93 from ClickHouse/release_1.1.8
Browse files Browse the repository at this point in the history
Backport settings fix, bump versions
  • Loading branch information
genzgd authored Sep 2, 2022
2 parents a72555b + 664f6bc commit fc52da7
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
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.1.7'
version = '1.1.8'
6 changes: 3 additions & 3 deletions dbt/include/clickhouse/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
{% set create_table = create_table_or_empty(temporary, relation, sql) %}
{% if adapter.is_before_version('22.7.1') -%}
{{ create_table }}
{{ adapter.get_model_settings(model) }}
{%- else %}
{% call statement('create_table_empty') %}
{{ create_table }}
Expand All @@ -88,20 +87,22 @@
engine = Memory
{{ order_cols(label="order by") }}
{{ partition_cols(label="partition by") }}
{{ adapter.get_model_settings(model) }}
{%- else %}
create table {{ relation.include(database=False) }}
{{ on_cluster_clause(label="on cluster") }}
{{ engine_clause(label="engine") }}
{{ order_cols(label="order by") }}
{{ primary_key_clause(label="primary key") }}
{{ partition_cols(label="partition by") }}
{{ adapter.get_model_settings(model) }}
{% if not adapter.is_before_version('22.7.1') -%}
empty
{%- endif %}
{%- endif %}
as (
{{ sql }}
);
)
{%- endmacro %}

{% macro clickhouse__create_view_as(relation, sql) -%}
Expand Down Expand Up @@ -224,7 +225,6 @@

insert into {{ target_relation }} ({{ dest_cols_csv }})
{{ sql }}
{{ adapter.get_model_settings(model) }}
{%- endmacro %}


Expand Down
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dbt-core==1.1.0
clickhouse-connect>=0.1.5
clickhouse-connect>=0.2.5
clickhouse-driver>=0.2.3
pytest==7.0.0
pytest-dotenv==0.5.2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _dbt_clickhouse_version():
},
install_requires=[
f'dbt-core~={dbt_version}',
'clickhouse-connect>=0.1.5',
'clickhouse-connect>=0.2.5',
'clickhouse-driver>=0.2.3',
],
python_requires=">=3.7",
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# repos. Example in dbt.tests.adapter.basic.test_base.
@pytest.fixture(scope="session")
def test_config():
run_docker = os.environ.get('RUN_DOCKER_ENV_VAR_NAME', False)
run_docker = os.environ.get('RUN_DOCKER_ENV_VAR_NAME', '').lower() in ('1', 'true', 'yes')
if run_docker:
# Run docker compose with clickhouse-server image.
compose_file = f'{Path(__file__).parent}/docker-compose.yml'
Expand Down
2 changes: 1 addition & 1 deletion tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'

services:
ch_server:
image: clickhouse/clickhouse-server
image: clickhouse/clickhouse-server:latest
ports:
- "10723:8123"
- "10743:8443"
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/adapter/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ class TestMergeTreeTabelMaterializations(BaseSimpleMaterializations):
@pytest.fixture(scope="class")
def models(self):
config_materialized_table = """
{{ config(order_by='(some_date, id, name)', engine='MergeTree()', materialized='table') }}
{{ config(order_by='(some_date, id, name)', engine='MergeTree()', materialized='table',
settings={'allow_nullable_key': 1}) }}
"""
base_table_sql = config_materialized_table + model_base
return {
Expand Down

0 comments on commit fc52da7

Please sign in to comment.