Skip to content

Downstream applications show warning about use of deprecated Pydantic feature #78

Description

@eecavanna

I maintain a Python app (nmdc-runtime) that depends on a Python package (ontology-loader) that, itself, has linkml-store as a dependency. When I run pytest on my app, I get a warning emanating from Pydantc, via linkml-store:

../venv/lib/python3.10/site-packages/pydantic/_internal/_config.py:323
  /venv/lib/python3.10/site-packages/pydantic/_internal/_config.py:323: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.11/migration/
    warnings.warn(DEPRECATION_MESSAGE, DeprecationWarning)

It has to do with linkml-store using a deprecated feature of Pydantic (i.e. the nested Config class).

Image

Here's a sequence of commands you can use to reproduce this, independently of any downstream app:

$ mkdir /tmp/linkml-store-warning && cd /tmp/linkml-store-warning
$ python -m venv .venv
$ source .venv/bin/activate

$ pip install "linkml-store[all]"
## (...most "pip install" output redacted...)
Successfully installed MarkupSafe-3.0.3 adbc-driver-flightsql-1.11.0 adbc-driver-manager-1.11.0 airium-0.2.7 alabaster-1.0.0 annotated-types-0.7.0 antlr4-python3-runtime-4.9.3 anyio-4.13.0 arrow-1.4.0 asteval-1.0.9 attrs-26.1.0 babel-2.18.0 backports-zstd-1.5.0 cachebox-5.2.3 certifi-2026.5.20 cffi-2.0.0 cfgraph-0.2.1 chardet-7.4.3 charset_normalizer-3.4.7 click-8.4.1 click-default-group-1.2.4 condense-json-0.1.3 contourpy-1.3.3 cryptography-48.0.1 curies-0.13.12 cycler-0.12.1 deepdiff-9.1.0 deprecated-1.3.1 distro-1.9.0 dnspython-2.8.0 docutils-0.22.4 duckdb-1.5.3 duckdb-engine-0.17.0 et-xmlfile-2.0.0 flatten-dict-0.5.0 flexcache-0.3 flexparser-0.4 fonttools-4.63.0 fqdn-1.5.1 google-api-core-2.31.0 google-auth-2.53.0 google-cloud-bigquery-3.41.0 google-cloud-core-2.6.0 google-crc32c-1.8.0 google-resumable-media-2.10.0 googleapis-common-protos-1.75.0 graphviz-0.21 grpcio-1.81.1 grpcio-status-1.81.1 h11-0.16.0 hbreader-0.9.1 httpcore-1.0.9 httpx-0.28.1 idna-3.18 imagesize-2.0.0 importlib-resources-7.1.0 iniconfig-2.3.0 interchange-2021.0.4 isodate-0.7.2 isoduration-20.11.0 jinja2-3.1.6 jiter-0.15.0 joblib-1.5.3 json-flattener-0.1.9 jsonasobj-1.3.1 jsonasobj2-1.0.4 jsonlines-4.0.0 jsonpatch-1.33 jsonpath-ng-1.8.0 jsonpointer-3.1.1 jsonschema-4.26.0 jsonschema-specifications-2025.9.1 kiwisolver-1.5.0 lark-1.3.1 linkml-1.11.1 linkml-map-0.5.2 linkml-renderer-0.3.1 linkml-runtime-1.11.1 linkml-store-0.3.2 llm-0.31 matplotlib-3.10.9 monotonic-1.6 more-itertools-11.1.0 multipledispatch-1.0.0 narwhals-2.22.1 neo4j-6.2.0 networkx-3.6.1 numpy-2.4.6 openai-2.41.1 openpyxl-3.1.5 orderly-set-5.5.0 packaging-26.2 pandas-3.0.3 pansi-2024.11.0 parse-1.22.1 pillow-12.2.0 pint-0.25.3 platformdirs-4.10.0 plotly-6.8.0 pluggy-1.6.0 prefixcommons-0.1.12 prefixmaps-0.2.6 proto-plus-1.28.0 protobuf-7.35.0 puremagic-2.2.0 py2neo-2021.2.4 pyarrow-24.0.0 pyasn1-0.6.3 pyasn1-modules-0.4.2 pycparser-3.0 pydantic-2.13.4 pydantic-core-2.46.4 pygments-2.20.0 pyjsg-0.12.4 pymongo-4.17.0 pyparsing-3.3.2 pyshex-0.9.0 pyshexc-0.10.3.post1 pystow-0.8.16 pytest-9.0.3 pytest-logging-2015.11.4 python-dateutil-2.9.0.post0 python-dotenv-1.2.2 python-ulid-3.1.0 pytz-2026.2 pyyaml-6.0.3 rdflib-7.6.0 rdflib-jsonld-0.6.1 rdflib-shim-1.0.3 referencing-0.37.0 regex-2026.5.9 requests-2.34.2 rfc3339-validator-0.1.4 rfc3987-1.3.8 roman-numerals-4.1.0 rpds-py-2026.5.1 scikit-learn-1.9.0 scipy-1.17.1 seaborn-0.13.2 setuptools-82.0.1 shexjsg-0.9.0 simpleeval-1.0.7 six-1.17.0 sniffio-1.3.1 snowballstemmer-3.1.1 sparqlslurper-0.5.1 sparqlwrapper-2.0.0 sphinx-9.1.0 sphinx-click-6.2.0 sphinxcontrib-applehelp-2.0.0 sphinxcontrib-devhelp-2.0.0 sphinxcontrib-htmlhelp-2.1.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-2.0.0 sphinxcontrib-serializinghtml-2.0.0 sqlalchemy-2.0.50 sqlite-fts4-1.0.3 sqlite-migrate-0.1b0 sqlite-utils-3.39 tabulate-0.10.0 threadpoolctl-3.6.0 tiktoken-0.13.0 tqdm-4.68.2 typing-extensions-4.15.0 typing-inspection-0.4.2 tzdata-2026.2 ucumvert-0.3.2 uri-template-1.3.0 urllib3-2.7.0 watchdog-6.0.0 webcolors-25.10.0 wrapt-2.2.1 xmltodict-1.0.4

$ PYTHONWARNINGS='default' python -c 'import linkml_store.api.queries'
/private/tmp/linkml-store-warning/.venv/lib/python3.12/site-packages/linkml_store/api/queries.py:41: PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.13/migration/
  class QueryResult(BaseModel):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions