Skip to content

Conversation

@cedric-orange
Copy link

When you are using some tools like dbt-loom, graph.nodes.values() returns nodes from multiples project.

dbt-loom works by fetching public model definitions from your dbt artifacts, and injecting those models into your dbt project.

The goal of this PR is to only retrieve nodes from the current project using project_name selection to avoid uploading of unnecessary information.

@michael-myaskovsky
Copy link
Contributor

Thanks for your contribution!
Please add a flag for this behavior, after that I'll be able to merge.

@cedric-orange
Copy link
Author

I haven't seen in contributing guide a section about flag. Could you explain to me what is required ?

@michael-myaskovsky
Copy link
Contributor

Since it changes the behavior, we want it to be an option that the user actively chooses. Either by configuration, or by an argument that the program receives. With the default being set to the original behavior.

@cedric-orange
Copy link
Author

This does not change current behavior.
But this protects against duplicates that are populated in the database when dbt-loom is used.

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for too long with no activity.
If you would like the pull request to remain open, please remove the stale label or leave a comment.

@github-actions github-actions bot added the Stale label Nov 18, 2025
Copy link
Contributor

@elazarlachkar elazarlachkar left a comment

Choose a reason for hiding this comment

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

Hi @cedric-orange!

I'm sorry for the delayed response.
Your PR looks good to me and I would like to merge it, I just commented with one question.
Could you look at it, and also update your branch to the latest elementary-data:master for the CI to pass?

Also, is that relevant also to groups and metrics artifacts?

{% set relation = elementary.get_elementary_relation('dbt_columns') %}
{% if execute and relation %}
{% set tables = graph.nodes.values() | list + graph.sources.values() | list %}
{% set tables = graph.nodes.values() | selectattr("package_name", "equalto", project_name) | list + graph.sources.values() | list %}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with project_name, but noticed in the dbt docs that it is accessed using the context (context[project_name]). Does this work without it?

@github-actions github-actions bot removed the Stale label Nov 21, 2025
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.

3 participants