Go to file
2025-02-19 08:57:58 -05:00
.github/workflows exlcude evm from recent 2025-02-05 08:08:14 -05:00
analyses initial 2023-04-24 15:50:49 -04:00
data updates (#71) 2024-11-05 10:43:09 -05:00
docs initial 2023-04-24 15:50:49 -04:00
macros updates (#96) 2025-02-03 10:32:30 -05:00
models exclude jellyverse from tx_toand sender test 2025-02-19 08:57:58 -05:00
snapshots initial 2023-04-24 15:50:49 -04:00
tests/sei_evm traces (#93) 2025-01-28 15:20:38 -05:00
.gitignore add so (#39) 2024-07-17 14:14:57 -06:00
dbt_project.yml AN-5462 dragonswap and ez_dex_swaps (#84) 2024-12-09 16:28:39 -05:00
LICENSE Initial commit 2023-04-21 16:00:18 -04:00
package-lock.yml macro traces (#59) 2024-09-25 15:10:23 -04:00
packages.yml macro traces (#59) 2024-09-25 15:10:23 -04:00
profiles.yml initial 2023-04-24 15:50:49 -04:00
README.md Sei txs, blocks, tx count pipeline (#2) 2023-08-29 12:26:28 -04:00
requirements.txt fix naming macro for 1.8 (#52) 2024-08-27 08:34:37 -07:00

Profile Set Up

Use the following within profiles.yml


sei:
  target: dev
  outputs:
    dev:
      type: snowflake
      account: <ACCOUNT>
      role: <ROLE>
      user: <USERNAME>
      password: <PASSWORD>
      region: <REGION>
      database: SEI_DEV
      warehouse: <WAREHOUSE>
      schema: silver
      threads: 4
      client_session_keep_alive: False
      query_tag: <TAG>

Variables

To control the creation of UDF or SP macros with dbt run:

  • UPDATE_UDFS_AND_SPS When True, executes all macros included in the on-run-start hooks within dbt_project.yml on model run as normal When False, none of the on-run-start macros are executed on model run

Default values are False

  • Usage: dbt run --var '{"UPDATE_UDFS_AND_SPS":True}' -m ...

Resources:

  • Learn more about dbt in the docs

  • Check out Discourse for commonly asked questions and answers

  • Join the chat on Slack for live discussions and support

  • Find dbt events near you

  • Check out the blog for the latest news on dbt's development and best practices

  • Check out the blog for the latest news on dbt's development and best practices

Applying Model Tags

Database / Schema level tags

Database and schema tags are applied via the add_database_or_schema_tags macro. These tags are inherited by their downstream objects. To add/modify tags call the appropriate tag set function within the macro.

{{ set_database_tag_value('SOME_DATABASE_TAG_KEY','SOME_DATABASE_TAG_VALUE') }}
{{ set_schema_tag_value('SOME_SCHEMA_TAG_KEY','SOME_SCHEMA_TAG_VALUE') }}

Model tags

To add/update a model's snowflake tags, add/modify the meta model property under config. Only table level tags are supported at this time via DBT.

{{ config(
    ...,
    meta={
        'database_tags':{
            'table': {
                'PURPOSE': 'SOME_PURPOSE'
            }
        }
    },
    ...
) }}

By default, model tags are not pushed to snowflake on each load. You can push a tag update for a model by specifying the UPDATE_SNOWFLAKE_TAGS project variable during a run.

dbt run --var '{"UPDATE_SNOWFLAKE_TAGS":True}' -s models/core/core__fact_swaps.sql

Querying for existing tags on a model in snowflake

select *
from table(sei.information_schema.tag_references('sei.core.fact_blocks', 'table'));