Oscar Westra van Holthe - Kind created AVRO-4146: ----------------------------------------------------
Summary: Python type checks fail Key: AVRO-4146 URL: https://issues.apache.org/jira/browse/AVRO-4146 Project: Apache Avro Issue Type: Bug Components: python Reporter: Oscar Westra van Holthe - Kind In our CI/CD build, the Python type checks fail with an error in {{io.py}}: {quote} avro/io.py:638: error: Argument 2 to "read_data" of "DatumReader" has incompatible type "Schema | None"; expected "Schema" {quote} In the method this error occurs in however, ensures that the parameter is never {{None}}. Below is the relevant build output: {noformat} Run python3 -m tox -e typechecks python3 -m tox -e typechecks shell: /usr/bin/bash -e {0} env: pythonLocation: /opt/hostedtoolcache/Python/3.10.17/x64 PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.10.17/x64/lib/pkgconfig Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.17/x64 Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.17/x64 Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.10.17/x64 LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.17/x64/lib typechecks: install_deps> python -I -m pip install coverage mypy .pkg: _optional_hooks> python /opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta .pkg: get_requires_for_build_sdist> python /opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta .pkg: get_requires_for_build_wheel> python /opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta .pkg: freeze> python -m pip freeze --all .pkg: pip==25.1.1,setuptools==80.3.1,wheel==0.45.1 .pkg: prepare_metadata_for_build_wheel> python /opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta .pkg: build_sdist> python /opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta typechecks: install_package_deps> python -I -m pip install 'typing-extensions; python_version < "3.8"' typechecks: install_package> python -I -m pip install --force-reinstall --no-deps /home/runner/work/avro/avro/lang/py/.tox/.tmp/package/2/avro-1.13.0+snapshot.tar.gz typechecks: freeze> python -m pip freeze --all typechecks: avro @ file:///home/runner/work/avro/avro/lang/py/.tox/.tmp/package/2/avro-1.13.0%2Bsnapshot.tar.gz#sha256=c06242a24c36999fa6abc6c6b721a315a07b4753d7eb58b9eb707365ce3ce8a3,coverage==7.8.2,mypy==1.16.0,mypy_extensions==1.1.0,pathspec==0.12.1,pip==25.1.1,setuptools==80.3.1,tomli==2.2.1,typing_extensions==4.13.2 typechecks: commands_pre[0]> mkdir -p avro/test/interop /home/runner/work/avro/avro/lang/py/../../build/interop/data typechecks: commands_pre[1]> cp -r /home/runner/work/avro/avro/lang/py/../../build/interop/data avro/test/interop typechecks: commands_pre[2]> coverage run -pm avro.test.gen_interop_data avro/interop.avsc avro/test/interop/data/py.avro typechecks: commands_pre[3]> cp -r avro/test/interop/data /home/runner/work/avro/avro/lang/py/../../build/interop typechecks: commands[0]> mypy avro/io.py:638: error: Argument 2 to "read_data" of "DatumReader" has incompatible type "Schema | None"; expected "Schema" [arg-type] Found 1 error in 1 file (checked 39 source files) typechecks: exit 1 (3.38 seconds) /home/runner/work/avro/avro/lang/py> mypy pid=2429{noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)