codeforkjeff / dbt-sqlite

A SQLite adapter plugin for dbt (data build tool)
Apache License 2.0
77 stars 13 forks source link

Add support for dbt 0.21.x #9

Closed cscetbon closed 3 years ago

cscetbon commented 3 years ago

Please add support for the latest version. with the latest dbt version I get

Running with dbt=0.20.0
Found 5 models, 19 tests, 0 snapshots, 0 analyses, 537 macros, 0 operations, 1 seed file, 0 sources, 0 exposures

Encountered an error:
Runtime Error
  Database Error
    no such table: main_dbt_test__audit.sqlite_master

It should be main.sqlite_master instead of main_dbt_test__audit.sqlite_master

Thanks

codeforkjeff commented 3 years ago

I think the problem is in the sqlite__list_relations_without_caching macro. dbt 0.20 seems to always look for relations in a schema named [database]_dbt_test__audit as part of the new functionality of storing test failures, even if you don't use the feature.

That macro should be changed to not execute the query on [database]_dbt_test__audit unless the schema exists. It may take me a few days before I can fix this.

cscetbon commented 3 years ago

That's exactly the issue I'm having. I don't understand how that schema makes sense when this feature is not used ...

codeforkjeff commented 3 years ago

I fixed this as well as another unrelated issue that came up with upgrading to dbt 0.20.0.

I've made a dbt-sqlite 0.2.0 release on pypi. Give that a try and let me know if you encounter any problems.

cscetbon commented 3 years ago

thanks @codeforkjeff it works better ! It fixed an exception I was getting in my tests as well