From 12e951471d6fe041aef06fa5142c4daa99b750c0 Mon Sep 17 00:00:00 2001 From: Jack Forgash <58153492+forgxyz@users.noreply.github.com> Date: Tue, 1 Aug 2023 10:29:14 -0600 Subject: [PATCH] upd slack msg (#139) * upd slack msg * Update dbt_test_alert.py * ! * alter tests --- models/gold/core__dim_topshot_metadata.yml | 2 -- models/gold/core__fact_blocks.yml | 1 + python_scripts/test_alert/dbt_test_alert.py | 10 +++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/models/gold/core__dim_topshot_metadata.yml b/models/gold/core__dim_topshot_metadata.yml index 89c30d1..f57ab63 100644 --- a/models/gold/core__dim_topshot_metadata.yml +++ b/models/gold/core__dim_topshot_metadata.yml @@ -110,8 +110,6 @@ models: - name: MOMENT_DATE description: "{{ doc('moment_date') }}" tests: - - not_null: - where: set_name not in ('Fit Check', 'The Champion\'s Path') AND NOT (set_name = '2023 NBA Playoffs' and SET_SERIES_NUMBER = 5) - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - TIMESTAMP_NTZ diff --git a/models/gold/core__fact_blocks.yml b/models/gold/core__fact_blocks.yml index e546e93..5575522 100644 --- a/models/gold/core__fact_blocks.yml +++ b/models/gold/core__fact_blocks.yml @@ -7,6 +7,7 @@ models: - sequence_gaps: column_name: block_height where: BLOCK_TIMESTAMP::DATE < CURRENT_DATE + severity: warn columns: - name: BLOCK_HEIGHT diff --git a/python_scripts/test_alert/dbt_test_alert.py b/python_scripts/test_alert/dbt_test_alert.py index 237102d..4b84b40 100644 --- a/python_scripts/test_alert/dbt_test_alert.py +++ b/python_scripts/test_alert/dbt_test_alert.py @@ -50,7 +50,7 @@ def log_test_result(): def create_message(**kwargs): messageBody = { - "text": f"Hey{' <@U037AH6DS8P>' if len(kwargs['messages']['fail']) > 0 else ''}, new DBT test results for :{os.environ.get('DATABASE').split('_DEV')[0]}: {os.environ.get('DATABASE')}", + "text": f"Hey{' ' if len(kwargs['messages']['fail']) > 0 else ''}, new DBT test results for :{os.environ.get('DATABASE').split('_DEV')[0]}: {os.environ.get('DATABASE')}", "attachments": [ { "color": kwargs["color"], @@ -80,13 +80,13 @@ def create_message(**kwargs): { "type": "button", - "text": "View the full run results", + "text": "View Warnings", "style": "primary", "url": "https://github.com/FlipsideCrypto/flow-models/actions/workflows/dbt_test.yml", "confirm": { - "title": "I haven't figured this part out yet", - "text": "I'm not sure how to get the run id from the workflow run, see all tests by clicking Ok", - "ok_text": "Ok", + "title": f"{kwargs['warn_count']} Warnings", + "text": "\n".join(kwargs["messages"]["warn"]) if len(kwargs["messages"]["warn"]) > 0 else "None :)", + "ok_text": "Continue to GHA", "dismiss_text": "Dismiss" } }