ethereum-models/macros/decoder/run_decoded_traces_history.sql
drethereum a8d19a517c
AN-5989/ethereum-migration (#1055)
* repo clean up

* silver changes

* silver streamline

* bronze sl

* macros

* wfs and decoded traces macro

* gold tags

* bronze tags

* beacon tags

* silver tags

* silver nft tags

* defi tags

* silver protocol tags

* workflow crons

* remove seed

* source

* refs

* docs

* docs

* sources

* remove complete function abis

* bronze issues

* curated updates

* column names

* column changes

* column changes

* tag
2025-05-20 10:17:57 -06:00

26 lines
842 B
SQL

{% macro run_decoded_traces_history() %}
{% set check_for_new_user_abis_query %}
SELECT
1
FROM
{{ ref('silver__user_verified_abis') }}
WHERE
_inserted_timestamp :: DATE = SYSDATE() :: DATE
AND DAYNAME(SYSDATE()) <> 'Sat' {% endset %}
{% set results = run_query(check_for_new_user_abis_query) %}
{% if execute %}
{% set new_user_abis = results.columns [0].values() [0] %}
{% if new_user_abis %}
{% set invoke_traces_query %}
SELECT
github_actions.workflow_dispatches(
'FlipsideCrypto',
'{{ blockchain }}' || '-models',
'dbt_run_streamline_decoded_traces_history.yml',
NULL
) {% endset %}
{% do run_query(invoke_traces_query) %}
{% endif %}
{% endif %}
{% endmacro %}