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

--models and --exclude flags ignored on dbt compile #2063

Closed
1 of 5 tasks
georgim0 opened this issue Jan 21, 2020 · 2 comments
Closed
1 of 5 tasks

--models and --exclude flags ignored on dbt compile #2063

georgim0 opened this issue Jan 21, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@georgim0
Copy link

Describe the bug

when running:
dbt compile --models +staging.area --exclude tag:myTag

it looks like it ignores the --models and --exclude flags as it compiles everything and produces a manifest.json that contains information about all the models.

the same manifest is used in docs which causes the lineage graph to include a lot of floating nodes that are not attached to anything.

Some more context:

The reason why those files are treated as models is because they are within my models directory, but they are just macros that are only relevant for that mart area.

I guess i could just move those macros out of models and define them at global level.

Expected behavior

Would expect to have the same behaviour as the run command

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

0.15.0

The output of python --version:
3.6

@georgim0 georgim0 added bug Something isn't working triage labels Jan 21, 2020
@drewbanin drewbanin removed the triage label Jan 22, 2020
@beckjake
Copy link
Contributor

I'm pretty sure the manifest written for dbt compile (and dbt run) only includes parsed manifest information, not compiled. dbt has to parse the entire manifest so that it can understand your selectors and refs, so we might as well include what we have in the output.

You can see if a model was selected by your dbt compile by looking at its compiled tab in the SQL section of its page. If there's no run_results.json entry corresponding tot he node (so it was not compiled), the section will say -- compiled SQL not found for this model.

@drewbanin Are you sure we should change this as suggested? It would involve changing how writing the manifest file actually works to take the models/exclude flags into account and only write selected nodes.

This use case in particular seems like it'd be best addressed by whatever fixes #1671, rather than changing what the selectors do to the generated manifest.

@jtcohen6
Copy link
Contributor

jtcohen6 commented Dec 3, 2020

Agree with the above: we want manifests to include information about all enabled nodes in the project. The --models and --exclude flags should only impact which nodes generate their compiled_sql. That's important as we continue to think about ways that manifests can be used to reliably represent a past project state.

I think there are other things we can do to make dbt-docs customizable, but I don't think it looks like writing partial manifests.

@jtcohen6 jtcohen6 closed this as completed Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants