fix: only select models in graph.nodes #132
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #
This is a:
All pull requests from community contributors should target the
main
branch (default).Description & motivation
I found about this bug while using the macro
generate_model_yaml
. It was incorrectly setting some column descriptions as empty. After some debugging, I found out thatget_model_dependencies
does not always resolve the node parent correctly.This PR fixes an edge case where you might have multiple nodes with the same name, for example in my case I had 1 analysis and 1 model that were called the exact same.
The
get_model_dependencies
macro assumes that there is only 1 match (always returns on the first node), so it silently in this case.Selecting only the models both fixes my example and also makes sure it doesn't break, since model names must be uniques (it is not true across all nodes in the graph).
Checklist