Fix vaults token key name and adding tests (#344)

* adjust vault dr

* test and token rename

* fix_test

* right path

* rename test
This commit is contained in:
WHYTEWYLL 2024-05-08 18:28:29 +03:00 committed by GitHub
parent 3411b12a72
commit bb14976e2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 28 additions and 4 deletions

View File

@ -36,5 +36,5 @@ jobs:
- name: Run DBT Jobs
run: |
dbt run-operation get_github_repo_data --args "{GITHUB_TOKEN: 'GB_TOKEN', frequency: ['last_year']}"
dbt run-operation get_github_repo_data --args "{GITHUB_TOKEN: 'TOKEN', frequency: ['last_year']}"
dbt run --model silver__github_activity

View File

@ -36,5 +36,6 @@ jobs:
- name: Run DBT Jobs
run: |
dbt run-operation get_github_repo_data --args "{GITHUB_TOKEN: 'GB_TOKEN', frequency: ['contributors']}"
dbt run-operation get_github_repo_data --args "{GITHUB_TOKEN: 'TOKEN', frequency: ['contributors']}"
dbt run --model silver__github_activity
dbt test -s github_data_null

View File

@ -36,5 +36,6 @@ jobs:
- name: Run DBT Jobs
run: |
dbt run-operation get_github_repo_data --args "{GITHUB_TOKEN: 'GB_TOKEN', frequency: ['core']}"
dbt run-operation get_github_repo_data --args "{GITHUB_TOKEN: 'TOKEN', frequency: ['core']}"
dbt run --model silver__github_activity
dbt test -s github_data_null

View File

@ -17,7 +17,7 @@ CREATE TABLE IF NOT EXISTS {{ target.database }}.bronze_api.github_repo_data(
{% set event_table %}
CREATE TABLE IF NOT EXISTS {{ target.database }}.bronze_api.log_messages (
CREATE OR REPLACE TABLE {{ target.database }}.bronze_api.log_messages (
timestamp TIMESTAMP_NTZ DEFAULT CURRENT_TIMESTAMP(),
log_level STRING,
message STRING

View File

@ -0,0 +1,22 @@
WITH base AS (
SELECT
SPLIT_PART(MESSAGE, ',',2) AS status_code,
count(*) as counter
FROM
{{ target.database }}.bronze_api.log_messages
WHERE
timestamp BETWEEN DATEADD(HOUR, -1, CURRENT_TIMESTAMP())
AND CURRENT_TIMESTAMP()
AND LOG_LEVEL = 'DEBUG'
GROUP BY 1
)
select
status_code,
counter
from
base
where
status_code not in (200, 202, 404, 451)
and counter > 0
and counter < 100