This is an automated email from the ASF dual-hosted git repository. potiuk pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push: new 69df34e52d Remove google-cloud-aiplatform when tests without pydantic are run (#38617) 69df34e52d is described below commit 69df34e52d01b7a75065ab2827152348d885ce0a Author: Jarek Potiuk <ja...@potiuk.com> AuthorDate: Fri Mar 29 14:03:32 2024 +0100 Remove google-cloud-aiplatform when tests without pydantic are run (#38617) The #37818 bumped requirement for google-cloud-aiplatform to a version that requires Pydantic so we need to remove it when we are running "no-pydantic" tests. The tests that import it should be skipped when the dependency is removed. --- Dockerfile.ci | 2 +- pyproject.toml | 2 ++ scripts/docker/entrypoint_ci.sh | 2 +- .../google/cloud/hooks/vertex_ai/test_batch_prediction_job.py | 4 ++++ .../google/cloud/hooks/vertex_ai/test_hyperparameter_tuning_job.py | 4 ++++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile.ci b/Dockerfile.ci index 7b238022c6..7fc4d56dfd 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1022,7 +1022,7 @@ function check_pydantic() { echo # shellcheck disable=SC2086 ${PACKAGING_TOOL_CMD} uninstall ${EXTRA_UNINSTALL_FLAGS} pydantic aws-sam-translator openai \ - pyiceberg qdrant-client cfn-lint weaviate-client + pyiceberg qdrant-client cfn-lint weaviate-client google-cloud-aiplatform pip check elif [[ ${PYDANTIC=} == "v1" ]]; then echo diff --git a/pyproject.toml b/pyproject.toml index f4803ae800..63f51e2141 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -355,6 +355,8 @@ combine-as-imports = true "airflow/security/utils.py" = ["E402"] "tests/providers/elasticsearch/log/elasticmock/__init__.py" = ["E402"] "tests/providers/elasticsearch/log/elasticmock/utilities/__init__.py" = ["E402"] +"tests/providers/google/cloud/hooks/vertex_ai/test_batch_prediction_job.py" = ["E402"] +"tests/providers/google/cloud/hooks/vertex_ai/test_hyperparameter_tuning_job.py" = ["E402"] "tests/providers/openai/hooks/test_openai.py" = ["E402"] "tests/providers/openai/operators/test_openai.py" = ["E402"] "tests/providers/qdrant/hooks/test_qdrant.py" = ["E402"] diff --git a/scripts/docker/entrypoint_ci.sh b/scripts/docker/entrypoint_ci.sh index 8b2ec5c09f..a0738dc1d6 100755 --- a/scripts/docker/entrypoint_ci.sh +++ b/scripts/docker/entrypoint_ci.sh @@ -243,7 +243,7 @@ function check_pydantic() { echo # shellcheck disable=SC2086 ${PACKAGING_TOOL_CMD} uninstall ${EXTRA_UNINSTALL_FLAGS} pydantic aws-sam-translator openai \ - pyiceberg qdrant-client cfn-lint weaviate-client + pyiceberg qdrant-client cfn-lint weaviate-client google-cloud-aiplatform pip check elif [[ ${PYDANTIC=} == "v1" ]]; then echo diff --git a/tests/providers/google/cloud/hooks/vertex_ai/test_batch_prediction_job.py b/tests/providers/google/cloud/hooks/vertex_ai/test_batch_prediction_job.py index 33b83bc352..1b2e0e1fbb 100644 --- a/tests/providers/google/cloud/hooks/vertex_ai/test_batch_prediction_job.py +++ b/tests/providers/google/cloud/hooks/vertex_ai/test_batch_prediction_job.py @@ -22,6 +22,10 @@ from unittest import mock import pytest from google.api_core.gapic_v1.method import DEFAULT + +# For no Pydantic environment, we need to skip the tests +pytest.importorskip("google.cloud.aiplatform_v1") + from google.cloud.aiplatform_v1 import JobState from airflow.exceptions import AirflowException diff --git a/tests/providers/google/cloud/hooks/vertex_ai/test_hyperparameter_tuning_job.py b/tests/providers/google/cloud/hooks/vertex_ai/test_hyperparameter_tuning_job.py index ce71b5f907..d2609b7f2f 100644 --- a/tests/providers/google/cloud/hooks/vertex_ai/test_hyperparameter_tuning_job.py +++ b/tests/providers/google/cloud/hooks/vertex_ai/test_hyperparameter_tuning_job.py @@ -22,6 +22,10 @@ from unittest import mock import pytest from google.api_core.gapic_v1.method import DEFAULT from google.cloud import aiplatform + +# For no Pydantic environment, we need to skip the tests +pytest.importorskip("google.cloud.aiplatform_v1") + from google.cloud.aiplatform_v1 import JobState from airflow.exceptions import AirflowException