Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-460] Add set_query_tag to the dbt macro namespace #133

Closed
robscriva opened this issue Apr 6, 2022 · 1 comment · Fixed by #132
Closed

[CT-460] Add set_query_tag to the dbt macro namespace #133

robscriva opened this issue Apr 6, 2022 · 1 comment · Fixed by #132
Labels
good_first_issue Good for newcomers type:enhancement New feature or request

Comments

@robscriva
Copy link
Contributor

robscriva commented Apr 6, 2022

Describe the feature

set_query_tag can only be overridden in the root project. By adding it to the dbt macro namespace, we can then leverage the dispatch functionality and override it with custom query tags in dbt packages.

Describe alternatives you've considered

The only way to achieve this is to add to the dbt macro namespace.

Additional context

https://getdbt.slack.com/archives/C37J8BQEL/p1633519489312300?thread_ts=1633377998.228400&cid=C37J8BQEL

Who will this benefit?

All dbt-snowflake users who have a central dbt package and would like to leverage custom query tags to be generated and stored at runtime. For example:

{
    "invocation_id": "{{ invocation_id }}",
    "run_started_at": "{{ run_started_at }}",
    "dbt_version": "{{ dbt_version }}",
    "project_name": "{{ project_name }}",
    "model":
    {
        "owners": "{{ tojson(model.meta.owners|default([])) }}",
        "database": "{{ this.database }}",
        "schema": "{{ this.schema }}",
        "name": "{{ this.name }}",
        "identifier": "{{ this.identifier }}",
        "path": "{{ model.path}}",
        "unique_id": "{{ model.unique_id }}",
        "materialized": "{{ model.config.materialized }}"
    }
}

Are you interested in contributing this feature?

Yes. #132 is currently in draft pending this issue creation.

@robscriva robscriva added type:enhancement New feature or request triage:product labels Apr 6, 2022
@github-actions github-actions bot changed the title Add set_query_tag to the dbt macro namespace [CT-460] Add set_query_tag to the dbt macro namespace Apr 6, 2022
@jtcohen6
Copy link
Contributor

@robscriva Sorry for the delay getting back to you on this one! Totally reasonable request. I'll take a look at the PR now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good_first_issue Good for newcomers type:enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants