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

InProgress: Add tags to SavedQueries #10987

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

theyostalservice
Copy link

@theyostalservice theyostalservice commented Nov 11, 2024

Resolves #

Problem

Solution

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Nov 11, 2024
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Copy link
Author

theyostalservice commented Nov 11, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment on lines 819 to 829
config_tags = config.get("tags")
unparsed_tags = unparsed.tags
tags: Union[List[str], str]
if config_tags:
if isinstance(config_tags, str):
config_tags = [config_tags]
if isinstance(unparsed_tags, str):
unparsed_tags = [unparsed_tags]
tags = list(set([*unparsed_tags, *config_tags]))
else:
tags = unparsed_tags
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: there's got to be a slightly cleaner way to write this.

theyostalservice added a commit to dbt-labs/dbt-semantic-interfaces that referenced this pull request Nov 14, 2024
Resolves [#369](#369)

### Description

Addresses internal Linear issue SL-2896.

Users currently can execute parts of their DAG conditionally based on tags added to individual nodes (see [documentation](https://docs.getdbt.com/reference/resource-configs/tags)).  This brings SavedQueries in line with other similar nodes and allows the use of tags as described in that documentation.  (See the added tests for examples.)

It does not add any hierarchical behaviors for these tags.

A related [PR #10987](dbt-labs/dbt-core#10987) is in progress in dbt-core.

### Checklist

- [x] I have read [the contributing guide](https://github.com/dbt-labs/dbt-semantic-interfaces/blob/main/CONTRIBUTING.md) and understand what's expected of me
- [x] I have signed the [CLA](https://docs.getdbt.com/docs/contributor-license-agreements)
- [x] This PR includes tests, or tests are not required/relevant for this PR
- [x] I have run `changie new` to [create a changelog entry](https://github.com/dbt-labs/dbt-semantic-interfaces/blob/main/CONTRIBUTING.md#adding-a-changelog-entry)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant