feat(pydevlake): migrate Python plugin framework to Pydantic v2 / SQLModel 0.0.38#1
Draft
DoDiODev wants to merge 1 commit into
Draft
feat(pydevlake): migrate Python plugin framework to Pydantic v2 / SQLModel 0.0.38#1DoDiODev wants to merge 1 commit into
DoDiODev wants to merge 1 commit into
Conversation
…Model 0.0.38 Migrate the pydevlake framework and the azuredevops remote plugin from Pydantic v1 to Pydantic v2 and SQLModel 0.0.38, and bump the related dependencies (inflect, fire, jsonpointer, pytest) and pin the Python runtime dependencies. Framework changes: - Replace v1 APIs: .json()/.dict() -> model_dump_json()/model_dump(), @validator -> @field_validator, inner class Config -> model_config via ConfigDict, Field(..., const=True) -> Literal, __root__ -> RootModel. - extractor.autoextract: construct models via model_validate so that SQLModel table=True models coerce raw values (str -> datetime/Enum), which v2 no longer does implicitly on __init__. - model_info: read the schema via model_json_schema, drop $defs and flatten Optional anyOf into a flat "type" expected by the Go backend. - Give Optional fields explicit "= None" defaults (required under v2) across the domain layer, tool/domain models, DomainModel.id and the azuredevops plugin models. - testing.assert_stream_convert: re-validate both operands so equality comparisons keep the v1 coercion semantics. Tooling: - uv.sh: force-reinstall local path dependencies so pydevlake source changes are always picked up (uv caches path deps by version, which stays 0.1.0 during development). - requirements.txt: pin setuptools/wheel/dbt-mysql/dbt-postgres. Verified with make unit-test-python and make e2e-test-go-plugins (both green) and a running server that loads the azuredevops remote plugin. Signed-off-by: DoDiODev <DoDiDev@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the pydevlake Python plugin framework and the azuredevops remote plugin from Pydantic v1 to Pydantic v2 and SQLModel 0.0.38, plus related dependency bumps and runtime pins.
Scope
Framework (
pydevlake).json()/.dict()→model_dump_json()/model_dump(),@validator→@field_validator, innerclass Config→model_config = ConfigDict(...),Field(..., const=True)→Literal,__root__→RootModel.extractor.autoextract: construct viamodel_validateso SQLModeltable=Truemodels coerce raw values (str→datetime/Enum), which v2 no longer does implicitly on__init__.model_info: read schema viamodel_json_schema, drop$defs, flattenOptionalanyOfinto a flattypeexpected by the Go backend.= Nonedefaults toOptionalfields (required under v2) across the domain layer, tool/domain models,DomainModel.id, and the azuredevops plugin models.testing.assert_stream_convert: re-validate both operands to preserve v1 coercion semantics in equality checks.Dependencies / tooling
pyproject.toml:sqlmodel ^0.0.38,pydantic ^2.13,inflect ^7.5,fire ^0.7,jsonpointer ^3.1,pytest ^9.1; regeneratedpoetry.locks.uv.sh: force-reinstall local path deps so pydevlake source changes are always picked up (uv caches path deps by the static0.1.0dev version).requirements.txt: pinsetuptools/wheel/dbt-mysql/dbt-postgres.Excluded
sqlglotchange (separate PR).Testing
make unit-test-python— green (azuredevops 8 passed/1 skipped, pydevlake 10 passed).make e2e-test-go-plugins— green (31 Go plugin e2e suites, no failures).Rollback
Revert this commit; the framework returns to the Pydantic v1 / SQLModel 0.0.8 state of the base branch.