#4140·altair

Fix deprecation warnings in pytest and jsonschema

Author: alec-bikeCreated Sep 14, 2026Updated Sep 14, 2026
Labelsbugneeds-triage

With the latest dependabot and type-checker version updates, several deprecation warnings have surfaced. Originally these were detailed in the following places:

The deprecation warnings are reproduced below.

parametrize-iterators deprecation in pytest

bash
> uv run task generate-schema-wrapper
Success: no issues found in 21 source files
...
.venv/lib/python3.12/site-packages/_pytest/python.py:124
  /Users/alec/Developer/altair/.venv/lib/python3.12/site-packages/_pytest/python.py:124: 
    PytestRemovedIn10Warning: Passing a non-Collection iterable to parametrize is deprecated.
  `Test: tests/expr/test_expr.py::test_expr_methods, argvalues type: generator
  Please convert to a list or tuple.`
  See https://docs.pytest.org/en/stable/deprecations.html#parametrize-iterators
    metafunc.parametrize(*marker.args, **marker.kwargs, _param_mark=marker)
...
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Also occurs for:

  • tests/expr/test_expr.py::test_expr_consts
  • tests/expr/test_expr.py::test_expr_consts_immutable

RefResolver deprecation in jsonschema

Raised by both ty and pyright:

bash
❯ uv run task type-check
...
warning[[deprecated](https://ty.dev/rules#deprecated)]: 
   The class `RefResolver` is deprecated
   --> tools/schemapi/schemapi.py:194:24
    |
194 |             jsonschema.RefResolver.from_schema(rootschema)
    |                        ^^^^^^^^^^^ jsonschema.RefResolver is deprecated as of
    v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, 
    which provides more compliant referencing behavior as well as more flexible APIs
    for customization. A future release will remove RefResolver. Please file a feature
    request (on referencing) if you are missing an API for the kind of customization 
    you need.

Also occurs on line 572.