dbt docs generate --exclude not working and doesn't exclude the models based on tags.

The problem I’m having

running the docs generate command for commercial environment like “#dbt docs generate --target --exclude tag:” is still trying to access the excluded models tag with ‘dev-only’

The context of why I’m trying to do this

So, we have separate environments like dev and prod and want to run the generate command for a single environment only

What I’ve already tried

just tried the --exclude option

Some example code or error messages

Building catalog
 Encountered an error while generating catalog: Database Error
  002003 (02000): SQL compilation error:
  Database '<DB_NAME_1>' does not exist or not authorized.
  Encountered an error while generating catalog: Database Error
  002003 (02000): SQL compilation error:
  Database '<DB_NAME_2>' does not exist or not authorized.
/home/github/_work/_temp/.sh: line 3:  2745 Killed                  dbt docs generate --target prod --exclude tag:frh-only

1 Like

Hi @shantanu.panda, at present dbt docs generate only captures the entire project; --exclude isn’t taken into account.

I would encourage you to weigh in on this discussion thread: Make it possible to generate a DBT docs subset · Discussion #5096 · dbt-labs/dbt-core · GitHub

2 Likes

I believe docs generate does take account of --select /--exclude , but only for compilation! It doesn’t respect selection criteria for actual catalog generation .

That’s this issue (in addition to the one Joel linked above):

2 Likes

Unfortunately this is still an issue, and the discussion thread on GitHub about this issue was closed, even though it’s not resolved. Is it possible to reopen?

I’ve just reopened this for you!

1 Like