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-2562] [Feature] support "depend on macro" selector in --select #7596
Comments
Thanks for opening @tema-popov -- clearly this a popular feature request across the developer team at FingerprintJS 😎 Could you share more detail about the potential use case and how it would benefit your team and others? Do you have a workaround that you are using today? |
Sure! If I change a model and want to re-run all models that depend on it I have a selector for that (I believe it is
Suppose, I changed the macro that was used in 2 other macros and several models. And all these macros and models also have models that depend on them. Right now I will just look through the code to see what models depend on changed macros, which requires manual work. Other options I have:
|
Thanks for that background @tema-popov ! Did you try state-based selection, by any chance? See relevant caveats for state-based selection here. If you have tried it before, will be curious how it did or didn't meet your needs. If not, I'll provide a short example below. Example using the "state" selector method
select {{ guid() }} as id
{% macro guid() %}
{{ return("'1'") }}
{% endmacro %}
dbt run
dbt run -s state:modified --state .
{% macro guid() %}
{{ return("'A'") }}
{% endmacro %}
dbt run -s state:modified --state . |
Oh, great, I will definitely try the |
We'll be interested to hear how the With the belief that it will do what you want, I'm going to close this issue as "not planned". But feel free to reach out if you think we should reconsider. Docs for state-based selectionThank you for mentioning that this feature was hard to know about. We definitely want you to know about all the tools at your disposal! 🔧 The state-based selector was added in 0.18.0, but many people either don't know about it or haven't used it before. If you have any suggestions to improve our documentation, we would welcome the feedback. There's two ways to do so: Propose an editIf you come across a page that lacks clear references or information about relevant features, you can help by submitting proposed edits. To do this, simply click on the "edit this page" link located near the bottom of every documentation page. This will allow you to suggest changes or additions to the content. Thank you for bringing this up, and please let me know if there's anything else I can assist you with! |
Is this your first time submitting a feature request?
Describe the feature
In case of updating the macro code, I want to select and run all models, that could depend on the macro. That includes
something like
dbt ls|run --select macro:macro_name
could work well for me.Describe alternatives you've considered
Discussion about workaround https://discourse.getdbt.com/t/is-there-a-way-to-select-models-that-depend-on-specific-macro/8217/2
Who will this benefit?
Anybody, who supports a lot of models in a project where it is dangerous or expensive to run all models in case of code change and it is hard to find all dependent models from the specified macro where the code and logic were changed.
Are you interested in contributing this feature?
no
Anything else?
No response
The text was updated successfully, but these errors were encountered: