duckdb/dbt-duckdb

Binder Error: Catalog "main" does not exist!

Tomperez98 opened this issue · 4 comments

Core:
  - installed: 1.3.2
  - latest:    1.4.1 - Update available!

  Your version of dbt-core is out of date!
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation

Plugins:
  - duckdb: 1.3.4 - Up to date!

Running the initial model dbt provides I'm getting this error

23:32:59  Runtime Error in model my_first_dbt_model (models/example/my_first_dbt_model.sql)
23:32:59    Binder Error: Catalog "main" does not exist!

this is my profiles.yml

default:
  target: dev
  outputs:
    dev:
      type: duckdb
      path: /tmp/dbt.duckdb

Hey @Tomperez98 sorry for the trouble here; this is an artifact of dbt-duckdb not being sync'd up with the latest 0.7.0 DuckDB release. I have this fixed on the master branch and will cut a release shortly (ideally tomorrow) to fix this, but in the meantime, here are a couple of workarounds for it:

  1. Pin your duckdb Python module to 0.6.1.
  2. Add a database property to the profiles.yml that matches the basename of your db file (so for this example, database: dbt would do the trick)

Will close the issue.

For me to get this working I just added the database property in the profiles.yml.

dbt_cli:
  target: dev
  outputs:
    dev:
      type: duckdb
      path: /tmp/dbt.duckdb
      database: dbt
00:10:10  Found 2 models, 4 tests, 0 snapshots, 0 analyses, 293 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics
00:10:10  
00:10:10  Concurrency: 1 threads (target='dev')
00:10:10  
00:10:10  1 of 2 START sql table model main.my_first_dbt_model ........................... [RUN]
00:10:10  1 of 2 OK created sql table model main.my_first_dbt_model ...................... [OK in 0.05s]
00:10:10  2 of 2 START sql view model main.my_second_dbt_model ........................... [RUN]
00:10:10  2 of 2 OK created sql view model main.my_second_dbt_model ...................... [OK in 0.03s]
00:10:10  
00:10:10  Finished running 1 table model, 1 view model in 0 hours 0 minutes and 0.12 seconds (0.12s).
00:10:10  
00:10:10  Completed successfully
00:10:10  
00:10:10  Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2

Thanks! @jwills

@Tomperez98 kind of you, but I'm going to re-open it lest someone else run into the same problem and come along to file the issue; I'll close it out when I get the next release out the door.

Should be all fixed in dbt-duckdb 1.4.0