mirror of
https://github.com/FlipsideCrypto/arbitrum-models.git
synced 2026-02-06 18:01:52 +00:00
AN-2582/unique-key-tx-test (#29)
* changed unique key in logs and traces and added new test in logs * added dbt-env to gitignore for SSO functionality * added .env to .gitignore to match current file * fixed typo
This commit is contained in:
parent
bbd134c7f7
commit
b52f79a7eb
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,4 +14,5 @@ logs/
|
||||
.history/
|
||||
**/.DS_Store
|
||||
.vscode/
|
||||
dbt-env/
|
||||
.env
|
||||
14
macros/tests/tx_block_count.sql
Normal file
14
macros/tests/tx_block_count.sql
Normal file
@ -0,0 +1,14 @@
|
||||
{% test tx_block_count(
|
||||
model,
|
||||
column_name
|
||||
) %}
|
||||
|
||||
SELECT
|
||||
{{ column_name }},
|
||||
COUNT(DISTINCT block_number) AS num_blocks
|
||||
FROM
|
||||
{{ model }}
|
||||
GROUP BY {{ column_name }}
|
||||
HAVING num_blocks > 1
|
||||
|
||||
{% endtest %}
|
||||
@ -1,7 +1,8 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = "_log_id",
|
||||
cluster_by = ['block_timestamp::DATE']
|
||||
unique_key = 'tx_hash',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
incremental_strategy = 'delete+insert'
|
||||
) }}
|
||||
|
||||
WITH base_txs AS (
|
||||
|
||||
@ -32,6 +32,10 @@ models:
|
||||
- not_null
|
||||
- dbt_expectations.expect_column_values_to_match_regex:
|
||||
regex: 0[xX][0-9a-fA-F]+
|
||||
- tx_block_count:
|
||||
config:
|
||||
severity: error
|
||||
error_if: "!=0"
|
||||
- name: EVENT_INDEX
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = '_call_id',
|
||||
cluster_by = ['block_timestamp::DATE']
|
||||
unique_key = 'tx_hash',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
incremental_strategy = 'delete+insert'
|
||||
) }}
|
||||
|
||||
WITH new_blocks AS (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user