If the DuckDB file is inaccessible for some reason during dbt initialization, you get a spurious exception being thrown like AttributeError: 'LocalEnvironment' object has no attribute 'conn' because the conn attribute of the LocalEnvironment was never set due to the DB file being inaccessible.
Fixing that by always setting the conn attribute to None before we try to connect to the DB file so as not to distract the user with an unhelpful error.
If the DuckDB file is inaccessible for some reason during dbt initialization, you get a spurious exception being thrown like
AttributeError: 'LocalEnvironment' object has no attribute 'conn'
because theconn
attribute of theLocalEnvironment
was never set due to the DB file being inaccessible.Fixing that by always setting the
conn
attribute toNone
before we try to connect to the DB file so as not to distract the user with an unhelpful error.