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,29 @@
|
||||
{% macro f2dq_metric_diff(context) %}
|
||||
max({{context.column_name}}) - min({{context.column_name}})
|
||||
{% endmacro %}
|
||||
|
||||
{% macro f2dq_metric_my_custom_table_metric(context) %}
|
||||
1000
|
||||
{% endmacro %}
|
||||
|
||||
{% macro f2dq_metric_regex_test(context) %}
|
||||
{{ regex_test(context.column_name, context.config.regex) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro regex_test(column_name, pattern) %}
|
||||
coalesce(
|
||||
sum(
|
||||
case when {{ f2dq.regex_match_expression(column_name, pattern) }}
|
||||
then 1
|
||||
else 0
|
||||
end
|
||||
), 0
|
||||
)
|
||||
{% endmacro %}
|
||||
|
||||
{% macro f2dq_metric_my_distinct_table_rows(context) %}
|
||||
with temp_table AS (
|
||||
select distinct * from {{ context.table_name }}
|
||||
)
|
||||
select coalesce(count(*), 0) FROM temp_table
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user