Fix table not found error for streamline block txs (#709)

* materialize the test output as a dbt modeled table

* reference the model instead of test output table
This commit is contained in:
desmond-hui 2024-11-14 06:51:52 -08:00 committed by GitHub
parent 46ed9e75bf
commit 9d6cd7ec59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 7 deletions

View File

@ -40,6 +40,12 @@ jobs:
run: |
pip install -r requirements.txt
dbt deps
# Run the streamline__transactions_and_votes_missing_7_days model to update after the tests
# This is necessary as the table is referenced in streamline views but DBT drops test output tables when they run
# so at time this will cause the streamline views to fail because the table it is trying to reference has been dropped.
# This should prevent that from happening by always referencing the model instead of the test output
- name: Run DBT Jobs
run: |
dbt test -s "solana_models,tag:test_hourly"
dbt test -s "solana_models,tag:test_hourly"
dbt run -s streamline__transactions_and_votes_missing_7_days

View File

@ -0,0 +1,10 @@
{{
config(
materialized = 'table',
)
}}
SELECT
*
FROM
{{ source('solana_test_silver','transactions_and_votes_missing_7_days') }}

View File

@ -88,12 +88,9 @@ solscan_discrepancy_retries AS (
SELECT
m.block_id
FROM
{{ source(
'solana_test_silver',
'transactions_and_votes_missing_7_days'
) }}
m
LEFT JOIN {{ ref('streamline__complete_block_txs') }} C
{{ ref('streamline__transactions_and_votes_missing_7_days') }} m
LEFT JOIN
{{ ref('streamline__complete_block_txs') }} C
ON C.block_id = m.block_id
WHERE
C._partition_id <= m._partition_id