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

Ability to run snapshot-freshness with tag selection #2369

Closed
nehiljain opened this issue Apr 28, 2020 · 7 comments
Closed

Ability to run snapshot-freshness with tag selection #2369

nehiljain opened this issue Apr 28, 2020 · 7 comments
Labels
enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors!

Comments

@nehiljain
Copy link

Describe the feature

Allow dbt users to run dbt source snapshot-freshness --select tag:mytag

DBT already has the ability to do this for models but would love to do this for sources as well.
Business Context:

Describe alternatives you've considered

  • Run the whole tree and not use tag selection

Who will this benefit?

Anyone who has dbt monorepo used by multiple teams. They can run trees inside dbt owned by different teams. These trees are tagged by team name so its as easy as dbt run -m tag:teamname, dbt test -m tag:teamname etc.

@nehiljain nehiljain added enhancement New feature or request triage labels Apr 28, 2020
@drewbanin drewbanin removed the triage label Apr 29, 2020
@drewbanin
Copy link
Contributor

Thanks for opening this issue @nehiljain! If you (or anyone else) is interested in working on this, I think it should be a pretty isolated change :)

@drewbanin drewbanin added the good_first_issue Straightforward + self-contained changes, good for new contributors! label Apr 29, 2020
@nehiljain
Copy link
Author

Yeah, I will take a crack at it. Do you want to point me to the relevant code files?

@beckjake
Copy link
Contributor

beckjake commented May 1, 2020

Hi @nehiljain, I think you'll want to change core/dbt/task/freshness.py, in particular the build_query method's include value.

@nehiljain
Copy link
Author

Is tagging supported at the source level? I was not able to see tags key on the sources in my manifest.json

Example:
snowflake_spend_manifest;.json

@drewbanin
Copy link
Contributor

hmm @nehiljain I do think I see the tags property on ParsedSnapshotNodes -- check out core/dbt/contracts/graph/parsed.py. My instinct is that the tags property is present on the Snapshot objects, but it's not being serialized to the manifest. Does that sound possible @beckjake?

@beckjake
Copy link
Contributor

beckjake commented May 4, 2020

@nehiljain Is it possible you're on dbt 0.15.x? Tags were added to the ParsedSourceDefinition object in 0.16.0.

In 0.17.x we seem to have regressed - tags appear to be getting clobbered by the new source-patching code. I'm surprised and annoyed to find that we apparently have no tests for this. Never mind, this was a mistake on my end - all is well on the source patching front 😌

@jtcohen6
Copy link
Contributor

Closing in favor of #2987, to be resolved by #3554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors!
Projects
None yet
Development

No branches or pull requests

4 participants