Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated Pydantic V1 functionality #97

Open
AndriesDraux opened this issue Sep 18, 2024 · 1 comment · May be fixed by #98
Open

Outdated Pydantic V1 functionality #97

AndriesDraux opened this issue Sep 18, 2024 · 1 comment · May be fixed by #98

Comments

@AndriesDraux
Copy link

AndriesDraux commented Sep 18, 2024

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.

PaddyAlton added a commit to PaddyAlton/dbt2looker that referenced this issue Oct 7, 2024
@PaddyAlton PaddyAlton linked a pull request Oct 7, 2024 that will close this issue
@PaddyAlton
Copy link

I had the exact same problem @AndriesDraux.

I've opened a PR from my fork which I hope the folks at Lightdash might be able to review at some point.

In the meantime it may help you fix your local install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants