dbt-labs / dbt-semantic-interfaces

The shared semantic layer definitions that dbt-core and MetricFlow use.
Apache License 2.0
71 stars 14 forks source link

[CT-3388] [Feature] Add support for pydantic 2.x #208

Closed mgierada closed 11 months ago

mgierada commented 11 months ago

Is this your first time submitting a feature request?

Describe the feature

Currently the dbt-core is pined to pydantic (>=1.10,<2.0). Let's make sure we can use the latest pydantic

The issue seems to be in the dbt-semantic-interfaces.

Describe alternatives you've considered

No response

Who will this benefit?

Everybody with a fairly modern tech stack.

Are you interested in contributing this feature?

Yes

Anything else?

No response

dbeatty10 commented 11 months ago

Thanks for raising this @mgierada !

I've transferred this issue here for follow-up. See below on quick notes about Pydantic V1.10 vs. V2.

Pydantic V1.10 vs. V2

Pydantic V2 is a ground-up rewrite that offers many new features, performance improvements, and some breaking changes compared to Pydantic V1.

If you're using Pydantic V1 you may want to look at the pydantic V1.10 Documentation or, 1.10.X-fixes git branch. Pydantic V2 also ships with the latest version of Pydantic V1 built in so that you can incrementally upgrade your code base and projects: from pydantic import v1 as pydantic_v1.

Location in source code

https://github.com/dbt-labs/dbt-semantic-interfaces/blob/b4c0a8290316a8b9695f735e6a42548445225a64/pyproject.toml#L23

QMalcolm commented 11 months ago

First, thank you so much for raising this issue! This was initially raised on dbt-core, and it got moved here because this repository (dbt-semantic-interfaces) is what is restricting the available pydantic version in dbt-core. However, we already have an issue tracking this work, https://github.com/dbt-labs/dbt-semantic-interfaces/issues/134, and thus I'm going to close this issue as a duplicate.