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

feat(dbt-ingestion): added possibility to skip specific models #3340

Merged
merged 14 commits into from
Oct 26, 2021
Merged

feat(dbt-ingestion): added possibility to skip specific models #3340

merged 14 commits into from
Oct 26, 2021

Conversation

AndreasTA-AW
Copy link
Contributor

Missed to use the tag prefix in last PR.
Also made it possible to filter out models that we would not want to push to DataHub. Common ones could be test seeds and such.

Updated the docs this time as well.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable)

@AndreasTA-AW AndreasTA-AW changed the title Dbt ingest fixes feat(dbt-ingestion): tag fixes and added possibility to skip specific models Oct 7, 2021
@AndreasTA-AW
Copy link
Contributor Author

Seems someone actually fixed the dbt prefix one day ago

@AndreasTA-AW
Copy link
Contributor Author

So I guess I should only add the model_name_pattern in that case

@AndreasTA-AW AndreasTA-AW changed the title feat(dbt-ingestion): tag fixes and added possibility to skip specific models feat(dbt-ingestion): added possibility to skip specific models Oct 7, 2021
@AndreasTA-AW
Copy link
Contributor Author

Is it possible to rerun the checks without pushing again?

@remisalmon
Copy link
Contributor

@AndreasTA-AW have you tried using node_type_pattern for that purpose? Models are nodes in the dbt catalog file and using node_type_pattern.deny="model.<something>" for ex. will work.

@AndreasTA-AW
Copy link
Contributor Author

I thought that one just checked the resource type, not the specifik name of a node. If that is the case it should work indeed.

@AndreasTA-AW
Copy link
Contributor Author

I double checked the code and it only looks at the resource_type, that is model, source, seed or test, but I would like the possibility to skip or only allow specifik models, seeds, test or sources, not the entire type

@AndreasTA-AW
Copy link
Contributor Author

Maybe it should be called name_pattern though, since it’s for all the types and not only models

@remisalmon
Copy link
Contributor

Right, node_type_pattern does not look at the full name. I would rename model_name_pattern to node_name_pattern.

(there is still some overlap with node_type_pattern: node_type_pattern.allow="model" and node_name_pattern.allow="model.*" would achieve the same thing)

@AndreasTA-AW
Copy link
Contributor Author

Ok, I'll rename it to node_name_pattern and hope the issue is done :)

owner = meta.get("owner")
if owner is None:
owner = manifest_node.get("config", {}).get("meta", {}).get("owner")
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there multiple ways to provide owner?

One through
manifest -> meta -> owner and another through manifest -> config -> meta -> owner ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, apparantly it's different for sources and models, which is a bit weird

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

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

LGTM!

@shirshanka shirshanka merged commit 561c04b into datahub-project:master Oct 26, 2021
maggiehays pushed a commit to maggiehays/datahub that referenced this pull request Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants