dbt2looker
dbt2looker copied to clipboard
Outdated Pydantic V1 functionality
Hey!
After updating to dbt version: dbt=1.8.6, the dbt2looker script started to fail:
The error message I received was:
ImportError: cannot import name 'PydanticValueError' from 'pydantic'
We are using dbt-core and dbt2looker==0.11.0.
I identified the issue being in the dbt2looker/models.py file where indeed an import is done of deprecated Pydantic functionality:
from pydantic import BaseModel, Field, PydanticValueError, validator. As far as I understand this is Pydantic V1 functionality which got deprecated by upgrading to Pydantic V2: here for example is stated that PydanticValueError is being deprecated.
I made already some changes in the dbt2looker/models.py to update it again to PydanticV2 compliant functionality - although not sure on the total impact - but by doing this I got the script running again.
Edit: apologies: I saw it was already filed once here. However, just reverting Pydantic in our virtual env is not really an option since dbt-semantic-layer is also relying on Pydantic v2.