Closed tvalentyn closed 7 months ago
Not sure how pydantic comes in the picture here yet, but for 'pydantic._hypothesis_plugin' to be available, it seems that we need to have 1.0.0<pydantic<2.0.0
Beam test infra installs pre-released dependencies to detect possible issues ahead of releases. The comand:
pip install --pre "tensorflow_transform>=1.13.0,<1.14.0" apache-beam[gcp,test]
installs pydantic==2.0a4
The command
pip install "tensorflow_transform>=1.13.0,<1.14.0" apache-beam[gcp,test]
installs pydantic==1.10.15
The tft requirement comes from: https://github.com/apache/beam/blob/21129a41e031c150c3f610639d71a95a3a941243/sdks/python/tox.ini#L316
from pipdeptree:
* google-cloud-aiplatform==1.46.0
- proto-plus [required: >=1.22.0,<2.0.0dev, installed: 1.24.0.dev0]
- pydantic [required: <3, installed: 2.0a4]
this seems to be an incorrect installer behavior. 2.0a4 shouln't be installed under these constraints.
not sure how that happens.
Likely what triggered the error for us was a recent release in https://pypi.org/project/google-cloud-aiplatform/#history , which added the pydantic dependency.
pydantic [required: <3, installed: 2.0a4] this seems to be an incorrect installer behavior. 2.0a4 shouln't be installed under these constraints.
Actually I misread this, it still fits the range but the chosen version is strange, there might be more constraints.
even though pip selects a bizzare version for pydantic, pydantic 2, this pydantic-hypothesis plugin seems broken
from pydantic import _hypothesis_plugin
fails, the more correct import from pydantic.v1 import _hypothesis_plugin
also fails with recent versions of hypthesis
https://stackoverflow.com/questions/71394400/how-to-block-the-hypothesis-pytest-plugin has some discussion how to disable it
The hypothesis plugin might be provided by hypothesis itself, and we might need it for tests that use hypothesis.
But looks like Pydantic 2 doesn't work with hypothesis: https://github.com/pydantic/pydantic/discussions/5979 , and somehow pydantic (which i believe we didn't have in our dependency chain before), now intefers with pytest/hypothesis. the fact that old version of pydantic gets installed due to --pre
flag may or may not be a factor.
the fact that old version of pydantic gets installed due to --pre flag may or may not be a factor.
that is the factor. The pydantic-2.0a4 distribution has the following:
(py38b) :py38b$ cat lib/python3.8/site-packages/pydantic-2.0a4.dist-info/entrypoints.txt [hypothesis] = pydantic._hypothesis_plugin
One other problem that causes additional failures in this suite is that in the test environment we first install test environment dependencies (e.g., tensorflow), then install the Beam package. This has implication on dependency resolution, and pip fails to resolve the conflicts.
We might be able to prevent that if we install both deps in the same command, asked on https://github.com/tox-dev/tox/issues/2386#issuecomment-2040435212 if that is possible.
What happened?
The 'coverage' suite runs some Beam unit tests in environments with different versions a particular dependency, for example we test severalversions of pyarrow or tft. The py38-tft-113 suite currently fails, likely due to a incompatible dependencies in tox environment:
Clues are in dependencies that were installed:
Issue Failure
Failure: Test is continually failing
Issue Priority
Priority: 1 (unhealthy code / failing or flaky postcommit so we cannot be sure the product is healthy)
Issue Components