codeforkjeff / dbt-sqlite

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

dbt 0.19.1 - missing field in dbt.adapters.sqlite.connections.SQLiteCredentials #7

Closed robastel closed 3 years ago

robastel commented 3 years ago

Firstly, thank you for building and releasing dbt-sqlite. I find it really useful!

With dbt-sqlite==0.1.0 and dbt==0.19.1, I am encountering the following error when running dbt compile:

Running with dbt=0.19.1
Encountered an error:
Field "extensions" of type typing.Union[str, NoneType] is missing in dbt.adapters.sqlite.connections.SQLiteCredentials instance

Previously, with dbt==0.19.0, everything was running smoothly for me.

I took another look at the dbt-sqlite README.md section on how to set up profiles.yml. This part in particular:

# optional: semi-colon separated list of file paths for SQLite extensions to load.
# digest.so is needed to provide for snapshots to work; see README
extensions: "/path/to/sqlite-digest/digest.so"

The error message I encountered leads me to consider that maybe extensions is no longer optional in dbt==0.19.1.

I was able to get around the error by following the idea of this comment in the dbt Slack group: https://getdbt.slack.com/archives/CJN7XRF1B/p1618594722275700?thread_ts=1618545451.270400&cid=CJN7XRF1B

For me it looks like:

extensions: "{{ 'None' | as_native }}"

Doing that eliminated the error for me and didn't seem to break anything with dbt-sqlite 0.18.x or 0.19.0.

There might be a simpler solution. I don't know enough about extensions to know. I just wanted to call it to your attention.

codeforkjeff commented 3 years ago

Hey, thanks for using this adapter and for reporting this!

I think dbt 0.19.0 should also have been complaining about this, not sure why it wasn't, I've committed a fix and released 0.1.1 on PyPI. With that new version, you should be able to omit 'extensions' completely if you don't want to set the value for it.

robastel commented 3 years ago

Thanks for the quick response! I am able to successfully omit 'extensions' again as you said.