Initial publish of dbt_f2dq (f2dq) package v0.12.1.
Clean package repo for Gitea installs via packages.yml git URL. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
{{
|
||||
config(
|
||||
materialized='table',
|
||||
)
|
||||
}}
|
||||
|
||||
-- depends_on: {{ ref('f2dq_run_started_at') }}
|
||||
-- depends_on: {{ ref('f2dq_monitored') }}
|
||||
-- depends_on: {{ ref('f2dq_selected') }}
|
||||
|
||||
{% if execute %}
|
||||
{% set schemas = run_query(f2dq.get_schemas()) %}
|
||||
{% if schemas %}
|
||||
|
||||
with columns_from_select as (
|
||||
{% for row in schemas %}
|
||||
{% set schema_name = f2dq.name_in_db(f2dq.row_value(row, 'schema')) %}
|
||||
{{ get_monitored_columns(schema_name, f2dq.row_value(row, 'database')) }}
|
||||
{%- if not loop.last %} union all {%- endif %}
|
||||
{% endfor %}
|
||||
)
|
||||
|
||||
select
|
||||
cast (table_name as {{ string_type() }} ) as name,
|
||||
cast (table_schema as {{ string_type() }} ) as schema,
|
||||
cast (table_catalog as {{ string_type() }} ) as database,
|
||||
cast (column_name as {{ string_type() }} ) as column_name,
|
||||
cast (data_type as {{ string_type() }} ) as data_type,
|
||||
cast (case is_nullable when 'YES' then 1 else 0 end as {{ boolean_type() }} ) as is_nullable,
|
||||
cast ({{dbt.current_timestamp_backcompat()}} as {{ timestamp_type() }}) as computed_on
|
||||
from columns_from_select
|
||||
|
||||
{% else %}
|
||||
{{ empty_columns_table() }}
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
{{ empty_columns_table() }}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,23 @@
|
||||
{{
|
||||
config(
|
||||
materialized='table',
|
||||
unique_key = 'table_name',
|
||||
post_hook="{% if execute %}{{ pub_insert_into_f2dq_monitored() }}{% endif %}"
|
||||
)
|
||||
}}
|
||||
|
||||
{{
|
||||
f2dq.empty_table_generic([
|
||||
('name', 'string'),
|
||||
('schema', 'string'),
|
||||
('database', 'string'),
|
||||
('time_filter', 'string'),
|
||||
('metrics_groups', 'string'),
|
||||
('additional_metrics', 'string'),
|
||||
('metrics', 'string'),
|
||||
('columns', 'string'),
|
||||
('anomaly_detector', 'string'),
|
||||
('owners', 'string'),
|
||||
('selected', 'boolean')
|
||||
])
|
||||
}}
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
select
|
||||
name, schema, database, time_filter, metrics, columns, anomaly_detector, owners
|
||||
from {{ ref('f2dq_monitored')}}
|
||||
where
|
||||
selected = true
|
||||
Reference in New Issue
Block a user