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-1102] [Feature] .dbtignore #5733

Closed
3 tasks done
jtcohen6 opened this issue Aug 30, 2022 · 1 comment · Fixed by #5897
Closed
3 tasks done

[CT-1102] [Feature] .dbtignore #5733

jtcohen6 opened this issue Aug 30, 2022 · 1 comment · Fixed by #5897
Labels
enhancement New feature or request python_models

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Aug 30, 2022

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

A .dbtignore file that uses .gitignore syntax (including pattern matching) to define files that should NOT be parsed/loaded by dbt.

Code for this would go in read_files

After thinking about this for 5 minutes, I don't think there would be unintended consequences for partial parsing. If a file is ignored, it's as if it were deleted; if it's un-ignored, it's as if it were created for the first time.

Describe alternatives you've considered

Regex support for model-paths, test-paths, etc. Gross

Who will this benefit?

https://getdbt.slack.com/archives/C03QUA7DWCW/p1661873024869149

Concretely, people who have .py files in their dbt projects that are not actually Python models!

Are you interested in contributing this feature?

No response

Anything else?

Another use case where this has come up: Removing unneeded files in dbt packages (#4837). Unfortunately, because of how dbt installs Hub packages, this would still require downloading all files and then deleting the "ignored" ones. See conversation in dbt-labs/hubcap#95.

@jtcohen6 jtcohen6 added enhancement New feature or request Team:Language labels Aug 30, 2022
@github-actions github-actions bot changed the title [Feature] .dbtignore [CT-1102] [Feature] .dbtignore Aug 30, 2022
@lostmygithubaccount
Copy link
Contributor

lostmygithubaccount commented Sep 6, 2022

there is this: https://github.com/mherrmann/gitignore_parser I'm not sure we should be comfortable using directly but likely implement what we'd need

obviously we could go find the source C code in here: https://github.com/git/git

from a quick look it didn't seem like the more standard GitPython package natively supports exactly this, but also probably useful: https://github.com/gitpython-developers/GitPython

similar functionality for .amlignore here: https://github.com/Azure/azure-sdk-for-python/blob/3a9c7813f3a41f18dd9ca07b1994f9b7d2785359/sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py

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

Successfully merging a pull request may close this issue.

2 participants