question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't generate dbt docs

See original GitHub issue

Describe the bug

We use the dbt-databricks adapter and can successfully read our models from dbt and also write them. However, when we call dbt docs generate we get the following error: Expected only one database in get_catalog, found.

To be on the safe side, I took another look at the source.yml. Unfortunately, only the schema is set there and I don’t know why dbt docs generate shouldn’t work.

Steps To Reproduce

Try to generate the dbt docs for a databricks destination / source

Expected behavior

Docs should be generated

Screenshots and log output

Bildschirmfoto 2022-02-15 um 08 26 43

System information

The output of dbt --version:

╰─$ dbt --version    
installed version: 1.0.1
   latest version: 1.0.1

Up to date!

Plugins:
  - databricks: 1.0.0
  - spark: 1.0.0

The operating system you’re using:

The output of python --version:

╰─$ python --version              
Python 3.8.12

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jtcohen6commented, Mar 18, 2022

Thanks for this @mcfuhrt! I was able to reproduce the error, using the example you’ve provided.

It looks like this line in your source definition is to blame:

    quoting:
      database: true

If I switch that to database: false, or remove that line entirely, docs generate works fine.

Alternatively, if I add those lines to dbt_project.yml so that the project-wide quoting config matches (docs), it also works.

There are two ways forward I can see:

  1. Fix the logic within SchemaSearchMap (called by _get_catalog_schemas), which currently views a quoted "None" database and an unquoted None database as distinct entries in the set of databases. This makes sense in the general case—they have different quote_policy—but it doesn’t make sense when the value is None.
  2. Defining this config doesn’t (shouldn’t) have any actual effect. Given that we don’t allow database to be defined elsewhere in dbt-spark (+ dbt-databricks, at least until https://github.com/dbt-labs/dbt-spark/issues/281), it really feels like our answer here should be to raise an explicit error any time the quoting config is defined at the database level. That could look like adding a __post_init__ hook to the SparkQuotePolicy:
    def __post_init__(self):
        if self.database:
            raise RuntimeException('Cannot set database-level quoting!')
0reactions
github-actions[bot]commented, Sep 15, 2022

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docs - dbt Developer Hub
dbt docs has two supported subcommands: generate and serve. ... The command is responsible for generating your project's documentation ...
Read more >
DBT view docs button didn't show up after successfully run ...
Try deleting your target/ folder and re-running dbt docs generate . If that doesn't work, you can reach out to the support team...
Read more >
Export documentation site as a set of static pages. · Issue #1916
I'd use something like Gatsby to create the static pages. ... dbt Docs was unable to load the mantifest file at path: manifest.json?cb= ......
Read more >
View your dbt documentation as a website - YouTube
Another great feature of dbt - Share all aspects of your dbt project by using the built in dbt docs command to serve...
Read more >
dbt (Data Build Tool) Integration | Welcome to FlexIt Learning
If using dbt CLI, you can connect to a Docs server or manually upload ... for your dbt config, then you cannot make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found