Go to file
2024-06-04 10:19:41 -04:00
.github/workflows upgrades (#26) 2024-05-31 11:25:10 -04:00
analyses initial 2023-04-24 15:50:49 -04:00
data An 4776/sei evm streamline (#12) 2024-04-25 09:19:13 -04:00
docs initial 2023-04-24 15:50:49 -04:00
macros upgrades (#26) 2024-05-31 11:25:10 -04:00
models traces key (#29) 2024-06-04 10:19:41 -04:00
snapshots initial 2023-04-24 15:50:49 -04:00
tests/sei_evm upgrades (#27) 2024-06-03 12:47:40 -04:00
.gitignore initial 2023-04-24 15:50:49 -04:00
dbt_project.yml fix tx_from for evn txns and cleanup workflows (#24) 2024-05-29 08:45:22 -04:00
LICENSE Initial commit 2023-04-21 16:00:18 -04:00
package-lock.yml AN-4762 streamline 2.0 (#11) 2024-04-24 13:16:23 -04:00
packages.yml AN-4762 streamline 2.0 (#11) 2024-04-24 13:16: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 workflows to reqs 2024-03-13 15:51:14 -04: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'));