microsoft/dbt-synapse

Import error on dbt-synapse 0.19.01

alittlesliceoftom opened this issue · 4 comments

Source:
https://github.com/dbt-msft/dbt-synapse/blob/5926747aadd3b18d0a47c2fbcbf639932f1881a4/dbt/adapters/synapse/connections.py#L2

Vanilla error:

Running with dbt=0.19.1
Error importing adapter: No module named 'dbt.adapters.sqlserver'
Encountered an error:
No module named 'dbt.adapters.sqlserver'

Detail error if run with dbt -d run:

python39\lib\site-packages\dbt\adapters\synapse\connections.py <module>
    from dbt.adapters.sqlserver import (SQLServerConnectionManager,

Is this just something needs adding to setup.py?

weird! I was seeing a lot of issues like this until we cut 0.19.0.1. can you run pip show dbt-synapse and/or dbt --version so we can confirm the adapter version you're using?

I'd be interested to see if a good ol' fashioned pip install --upgrade dbt-synapse might resolve the issue....

When you say 'cut' you mean created right. Just spent 5 mins trying to install >19.0.1 until I remembered American :)

pip install --upgrade dbt-synapse no dice - was already on 0.19.0.1.

pip install --upgrade dbt-sqlserver -seemed to improve things, now just got a 'sqlserver__type_string' is undefined, which should fix with a dbt deps :)

It looks like dbt-sqlserver was defaulting to 0.19.0.1 but 0.19.0.2 is working better. What do you get if you

pip list | grep dbt

This is mine after the manual upgrade of dbt-sqlserver, which now works (except strings)
dbt-core 0.19.1
dbt-sqlserver 0.19.0.2
dbt-synapse 0.19.0.1

Change:

install_requires=[
    "dbt-sqlserver~=0.19.0",
    "agate>=1.6,<1.6.2"
]

To
"dbt-sqlserver>=0.19.0.2"

Weird!

My env uses dbt-sqlserver==0.19.0.1 and it works fine. That said, having a four-part version number is not really SemVer so it could be tripping up the ~= pip operator.

Happy if you want to make a PR for your suggested change, though I think the permanent fix is for @mikaelene to abandon using four-part versions...

dbt-core                         0.19.1
dbt-sqlserver                    0.19.0.1
dbt-synapse                      0.19.0.1