dr-leo / pandaSDMX

Python interface to SDMX
Apache License 2.0
125 stars 58 forks source link

Pydantic V2 compatibility #246

Open FlorianTsch opened 11 months ago

FlorianTsch commented 11 months ago

Pydantic V2 deprecated "class_validators.py" which leads to an error while trying to import pandasdmx, as the function "make_generic_validator" can no longer be found.

dr-leo commented 11 months ago

This version is not supported. Please downgrade pydantic. Next release will remove this dependency.Am 08.08.2023 um 16:52 schrieb FlorianTsch @.***>: Pydantic V2 deprecated "class_validators.py" which leads to an error while trying to import pandasdmx, as the function "make_generic_validator" can no longer be found.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

mephinet commented 10 months ago

Hi @dr-leo , just out of curiosity: will pydantic as a whole be removed, or just the 1.x limitation? Asking because I'm currently thinking whether to start using pydantic in a new project... Thanks!

kiloreven commented 9 months ago

Hi, really appreciate this project! Is there a timeline for when the next version will be released? We use this library as a dependency in a project with pydantic that we wish to upgrade :)

frediy commented 6 months ago

Pandas SDMX does use a significant amount of pydantic features, some of which I'm not too familiar with. The pydantic V2 has a large number of breaking changes as well, so could take some effort. I'll take a stab at it though.

frediy commented 6 months ago

@dr-leo I've been taking a stab at pydantic v2 compatibility in the PR above. Could you please clarify whether you intend to remove the dependency on pydantic entirely in pandasdmx or whether you intend to introduce pydantic v2 compatibility?

Removing the pydantic dependency entirely seems a fairly substantial rewrite - if not full rewrite. Even if doing so, it might be best to introduce pydantic v2 compatibility until the dependency can be removed as this might take a long time? Adding pydantic v2 compatibility is definitely a fair bit of work, but not unmanageable from what I can tell by giving it a go so far.

That being said, I think the amount of breaking changes that were introduced in pydantic v2 warrants caution in terms of continuing to depend on it. The best long term strategy seems to be to get rid of it. It has sent dependency updates to a firm halt for many libraries and applications, including many that I'm currently working on.

frediy commented 3 months ago

Hi @dr-leo, would be great if you could follow up on the issue above ☝️ It's a pretty hairy upgrade, so would be great to know if you think it's worth doing or not.

leofj commented 1 week ago

I'd also love if this library would support pydantic v2, we're updating our services and this is a blocker