Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change metric assertion. #492

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions integration_tests/tests/test_metrics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import random
from dataclasses import dataclass
from datetime import datetime
from typing import List

import pytest
Expand Down Expand Up @@ -56,14 +55,13 @@ def validate_metrics(
dbt_project: DbtProject,
remaining_models_to_row_count: dict,
):
now = datetime.utcnow()
for metric in dbt_project.read_table("data_monitoring_metrics"):
for model_name, row_count in remaining_models_to_row_count.items():
if model_name.upper() in metric["full_table_name"]:
if metric["metric_name"] == "row_count":
assert metric["metric_value"] == row_count
elif metric["metric_name"] == "build_timestamp":
assert metric["metric_value"] < now.timestamp()
assert type(metric["metric_value"]) == float
remaining_models_to_row_count.pop(model_name)
break

Expand Down