Skip to content

Commit

Permalink
Added validations.
Browse files Browse the repository at this point in the history
  • Loading branch information
elongl committed Jun 30, 2024
1 parent c7f036a commit b8efed3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions macros/edr/tests/test_utils/collect_column_metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
{% do exceptions.raise_compiler_error("Unable to find column `{}` in `{}`".format(column_name, model_relation)) %}
{% endif %}
{% set column_monitors = column_obj_and_monitors.monitors %}
{% if not column_monitors %}
{% do exceptions.raise_compiler_error("Unable to collect metrics for: '{}'.".format(metric_names)) %}
{% endif %}

{% set column_obj = column_obj_and_monitors.column %}

{% if metric_props.timestamp_column %}
Expand Down
3 changes: 3 additions & 0 deletions macros/edr/tests/test_utils/collect_table_metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
{% do metric_names.append(metric.name) %}
{% endfor %}
{% set table_monitors = elementary.get_final_table_monitors(monitors=metric_names) %}
{% if not table_monitors %}
{% do exceptions.raise_compiler_error("Unable to collect metrics for: '{}'.".format(metric_names)) %}
{% endif %}

{% if dimensions and table_monitors != ["row_count"] %}
{% do exceptions.raise_compiler_error("collect_metrics test does not support non row_count dimensional table metrics.") %}
Expand Down

0 comments on commit b8efed3

Please sign in to comment.