File tree Expand file tree Collapse file tree 5 files changed +31
-4
lines changed
deprecated_tests/macros/e2e_tests
macros/utils/table_operations Expand file tree Collapse file tree 5 files changed +31
-4
lines changed Original file line number Diff line number Diff line change 5151 clickhouse,
5252 ]
5353 include :
54- # If we're not running on a specific dbt version, then always add postgres on 1.7 .0
55- - dbt-version : " ${{ inputs.dbt-version || '1.7 .0' }}"
54+ # If we're not running on a specific dbt version, then always add postgres on 1.8 .0
55+ - dbt-version : " ${{ inputs.dbt-version || '1.8 .0' }}"
5656 warehouse-type : postgres
5757 - dbt-version : " ${{ inputs.dbt-version || 'latest_pre' }}"
5858 warehouse-type : postgres
Original file line number Diff line number Diff line change 1616{% endmacro %}
1717
1818{% macro drop_schema(database_name, schema_name) %}
19+ {% do adapter .dispatch (' drop_schema' )(database_name, schema_name) %}
20+ {% endmacro %}
21+
22+ {% macro default__drop_schema(database_name, schema_name) %}
1923 {% set schema_relation = api .Relation .create(database= database_name, schema= schema_name) %}
2024 {% do dbt .drop_schema (schema_relation) %}
2125 {% do adapter .commit () %}
2226 {% do elementary .edr_log (" dropped schema {}" .format(schema_relation | string)) %}
2327{% endmacro %}
28+
29+ {% macro clickhouse__drop_schema(database_name, schema_name) %}
30+ {% set results = run_query(" SELECT name FROM system.tables WHERE database = '" ~ database_name ~ " '" ) %}
31+ {% if execute %}
32+ {% for row in results %}
33+ {% set table = row[0 ] %}
34+ {% do run_query(" DROP TABLE IF EXISTS " ~ database_name ~ " ." ~ table) %}
35+ {% endfor %}
36+ {% endif %}
37+ {% do adapter .commit () %}
38+ {% do elementary .edr_log (" dropped schema {}" .format(schema_name)) %}
39+ {% endmacro %}
Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ def test_artifacts_caching(dbt_project: DbtProject):
2323 assert first_row == second_row , "Artifacts are not cached at the on-run-end."
2424
2525
26- # Artifacts updating currently not supported on ClickHouse
27- @pytest .mark .skip_targets (["clickhouse" ])
2826def test_artifacts_updating (dbt_project : DbtProject ):
2927 # Disabled by default in the tests for performance reasons.
3028 dbt_project .dbt_runner .vars ["disable_dbt_artifacts_autoupload" ] = False
Original file line number Diff line number Diff line change 1818 {% do return(false) %}
1919{% endmacro %}
2020
21+ {% macro clickhouse__has_temp_table_support() %}
22+ {% do return(false) %}
23+ {% endmacro %}
24+
Original file line number Diff line number Diff line change 5353 {% do return(tmp_relation) %}
5454{% endmacro %}
5555
56+ {% macro clickhouse__make_temp_table_relation(base_relation, suffix) %}
57+ {% set tmp_identifier = elementary .table_name_with_suffix (base_relation .identifier , suffix) %}
58+ {% set tmp_relation = api .Relation .create(
59+ identifier= tmp_identifier,
60+ schema= base_relation .schema ,
61+ database= base_relation .database ,
62+ type= ' table' ) %}
63+ {% do return(tmp_relation) %}
64+ {% endmacro %}
You can’t perform that action at this time.
0 commit comments