mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 11:26:53 +00:00
Modify Transaction Results (#427)
* rm data from complete txres model * comment * rm data from complete tx * add manual load to txres * add RETRY_WINDOW var * fix tx final RETRY_WINDOW
This commit is contained in:
parent
5725799ff6
commit
1ae1816673
@ -12,7 +12,7 @@
|
||||
SELECT
|
||||
block_number,
|
||||
id AS tx_id,
|
||||
DATA: error_message :: STRING AS error_message,
|
||||
DATA :error_message :: STRING AS error_message,
|
||||
DATA :events :: ARRAY AS events,
|
||||
DATA :status :: INT AS status,
|
||||
DATA :status_code :: INT AS status_code,
|
||||
@ -30,6 +30,10 @@ FROM
|
||||
{{ ref('bronze__streamline_transaction_results_history') }}
|
||||
-- TODO need incremental logic of some sort probably (for those 5800 missing txs)
|
||||
-- where inserted timestamp >= max from this where network version = backfill version OR block range between root and end
|
||||
{% elif var('MANUAL_FIX', False) %}
|
||||
{{ ref('bronze__streamline_fr_transaction_results') }}
|
||||
WHERE
|
||||
_partition_by_block_id BETWEEN {{ var('RANGE_START', 0) }} AND {{ var('RANGE_END', 0) }}
|
||||
{% else %}
|
||||
|
||||
{% if is_incremental() %}
|
||||
@ -43,7 +47,7 @@ WHERE
|
||||
)
|
||||
-- AND _partition_by_block_id > 107700000 -- march 27th 2025
|
||||
-- AND _partition_by_block_id > 108000000 -- march 28th 2025
|
||||
AND _partition_by_block_id > 108800000 -- april 5th 2025
|
||||
-- AND _partition_by_block_id > 108800000 -- april 5th 2025
|
||||
{% else %}
|
||||
{{ ref('bronze__streamline_fr_transaction_results') }}
|
||||
{% endif %}
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
block_height
|
||||
FROM """ ~ this ~ """
|
||||
WHERE
|
||||
modified_timestamp >= SYSDATE() - INTERVAL '7 days'
|
||||
modified_timestamp >= SYSDATE() - INTERVAL '""" ~ var('RETRY_WINDOW', 3) ~ """ days'
|
||||
AND (
|
||||
block_timestamp IS NULL
|
||||
OR pending_result_response
|
||||
@ -43,7 +43,7 @@
|
||||
)
|
||||
OR -- re-run record if block comes in later than tx records
|
||||
(
|
||||
modified_timestamp >= SYSDATE() - INTERVAL '3 days'
|
||||
modified_timestamp >= SYSDATE() - INTERVAL '""" ~ var('RETRY_WINDOW', 3) ~ """ days'
|
||||
AND
|
||||
tx_id IN (
|
||||
SELECT
|
||||
@ -81,7 +81,7 @@ tx_results AS (
|
||||
|
||||
{% if is_incremental() %}
|
||||
WHERE
|
||||
modified_timestamp >= SYSDATE() - INTERVAL '3 days'
|
||||
modified_timestamp >= SYSDATE() - INTERVAL '{{ var('RETRY_WINDOW', 3) }} days'
|
||||
AND tx_id IN (
|
||||
SELECT
|
||||
DISTINCT tx_id
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
SELECT
|
||||
id,
|
||||
DATA,
|
||||
block_number,
|
||||
_partition_by_block_id,
|
||||
_inserted_timestamp
|
||||
@ -28,7 +27,6 @@ WHERE
|
||||
),
|
||||
'1900-01-01' :: timestamp_ntz
|
||||
)
|
||||
AND _partition_by_block_id > 108800000
|
||||
-- id NOT IN (
|
||||
-- 'f31f601728b59a0411b104e6795eb18e32c9b1bea3e52ea1d28a801ed5ceb009',
|
||||
-- 'b68b81b7a2ec9fb4e3789f871f95084ba4fdd9b46bb6c7029efa578a69dba432'
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
SELECT
|
||||
id,
|
||||
data,
|
||||
block_number,
|
||||
_partition_by_block_id,
|
||||
_inserted_timestamp
|
||||
|
||||
@ -68,11 +68,6 @@ SELECT
|
||||
) AS request
|
||||
FROM
|
||||
transactions_to_ingest
|
||||
WHERE
|
||||
block_height > 108800000
|
||||
-- transaction_id NOT IN (
|
||||
-- 'f31f601728b59a0411b104e6795eb18e32c9b1bea3e52ea1d28a801ed5ceb009',
|
||||
-- 'b68b81b7a2ec9fb4e3789f871f95084ba4fdd9b46bb6c7029efa578a69dba432'
|
||||
-- )
|
||||
|
||||
ORDER BY
|
||||
block_height DESC
|
||||
|
||||
Loading…
Reference in New Issue
Block a user