Skip to content

Commit

Permalink
Remove google-cloud-aiplatform when tests without pydantic are run (#…
Browse files Browse the repository at this point in the history
…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.

(cherry picked from commit 69df34e)
  • Loading branch information
potiuk authored and ephraimbuddy committed Apr 2, 2024
1 parent 8d12bb1 commit d46d7ec
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,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
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/entrypoint_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
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
Expand Down

0 comments on commit d46d7ec

Please sign in to comment.