Skip to content

Commit 057b343

Browse files
authored
Merge pull request #375 from elementary-data/ele-1061-databricks-enabledfalse-gets-override-by-user-config
Made databricks avoid running info schema models even if user `enabled: true`
2 parents 62d41e7 + 0393463 commit 057b343

File tree

9 files changed

+11
-36
lines changed

9 files changed

+11
-36
lines changed

macros/edr/metadata_collection/get_columns_by_schemas.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
{%- if configured_schemas | length > 0 -%}
33
{{ elementary.union_macro_queries(configured_schemas, elementary.get_columns_from_information_schema) }}
44
{%- else %}
5-
{{ elementary.empty_table([('full_table_name', 'string'), ('database_name', 'string'), ('schema_name', 'string'), ('table_name', 'string'), ('column_name', 'string'), ('data_type', 'string')]) }}
5+
{{ elementary.get_empty_columns_from_information_schema_table() }}
66
{%- endif %}
77
{% endmacro %}

macros/edr/metadata_collection/get_columns_from_information_schema.sql

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,12 @@
4343
from information_schema.columns
4444
where upper(table_schema) = upper('{{ schema_name }}')
4545

46-
{% endmacro %}
46+
{% endmacro %}
47+
48+
{% macro spark__get_columns_from_information_schema(database_name, schema_name) %}
49+
{{ elementary.get_empty_columns_from_information_schema_table() }}
50+
{% endmacro %}
51+
52+
{% macro get_empty_columns_from_information_schema_table() %}
53+
{{ elementary.empty_table([('full_table_name', 'string'), ('database_name', 'string'), ('schema_name', 'string'), ('table_name', 'string'), ('column_name', 'string'), ('data_type', 'string')]) }}
54+
{% endmacro %}

macros/edr/system/system_utils/get_config_var.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
'disable_tests_results': false,
3333
'disable_dbt_artifacts_autoupload': false,
3434
'disable_dbt_invocation_autoupload': false,
35-
'enable_dbt_columns': true,
3635
'disable_skipped_model_alerts': true,
3736
'disable_skipped_test_alerts': true,
3837
'dbt_artifacts_chunk_size': 5000,

models/edr/alerts/alerts_schema_changes.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
config(
33
materialized = 'view',
44
bind=False,
5-
enabled = target.type != 'databricks' and target.type != 'spark' | as_bool()
65
)
76
}}
87

models/edr/data_monitoring/schema_changes/schema_columns_snapshot.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
config(
33
materialized='incremental',
44
unique_key = 'column_state_id',
5-
enabled = target.type != 'databricks' and target.type != 'spark' | as_bool(),
65
on_schema_change = 'append_new_columns',
76
full_refresh=elementary.get_config_var('elementary_full_refresh'),
87
meta={

models/edr/dbt_artifacts/dbt_columns.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{
22
config(
33
materialized = 'view' if not var('sync', false) else 'table',
4-
enabled = elementary.get_config_var('enable_dbt_columns') and target.type != 'databricks' and target.type != 'spark' | as_bool()
54
)
65
}}
76

models/edr/metadata_store/filtered_information_schema_columns.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{
22
config(
33
materialized = 'view',
4-
enabled = target.type != 'databricks' and target.type != 'spark' | as_bool()
54
)
65
}}
76

@@ -13,4 +12,4 @@ with filtered_information_schema_columns as (
1312

1413
select *
1514
from filtered_information_schema_columns
16-
where full_table_name is not null
15+
where full_table_name is not null

models/edr/metadata_store/filtered_information_schema_tables.sql

Lines changed: 0 additions & 22 deletions
This file was deleted.

models/elementary_tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,3 @@ models:
3535
Queries the columns view from the information schema of the schemas in the project.
3636
This view is generated using an adapter specific macro, as information schema is different between platforms.
3737
This is a view to make the work with the information schema more convenient.
38-
39-
- name: filtered_information_schema_tables
40-
description: >
41-
Queries the tables and schemas views from the information schema of the schemas in the project.
42-
This view is generated using an adapter specific macro, as information schema is different between platforms.
43-
This is a view to make the work with the information schema more convenient.

0 commit comments

Comments
 (0)