Closed skshetry closed 1 year ago
@skshetry is there a reason to support both?
@skshetry is there a reason to support both?
Studio still relies on MLEM and therefore on Pydantic v1. Also I did not want to block any DVC users that are using pydantic v2 (or, pydantic v1 even).
Also, using pydantic v2 APIs means changing code, whereas if we use v1 APIs for now, we can support both and is working perfectly fine.
sounds good. can we run tests with both then?
I consider pydantic v1 support as best effort from now on. I don’t think we need to test both.
sound good, I think Studio has enough tests to detect failure if there is a regression in pydantic v1
Also supports pydantic v1.
pydantic v2 provides v1 api through
pydantic.v1
import, so we can support both versions by trying to import frompydantic.v1
and fallback to old behaviour.See https://docs.pydantic.dev/latest/migration/#continue-using-pydantic-v1-features.
pydantic == 2.0.0 does not work due to https://github.com/pydantic/pydantic/issues/6361, so we need to blacklist that specific version.