Skip to content

Commit

Permalink
Fix failing no-pydantic tests for OpenAI. (#41677)
Browse files Browse the repository at this point in the history
The #41554 broke exclusion of openai tests when no pydantic is
installed.
  • Loading branch information
potiuk authored Aug 22, 2024
1 parent c2a9833 commit c19986c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,11 @@ combine-as-imports = true
"tests/providers/google/cloud/operators/vertex_ai/test_generative_model.py" = ["E402"]
"tests/providers/google/cloud/triggers/test_vertex_ai.py" = ["E402"]
"tests/providers/openai/hooks/test_openai.py" = ["E402"]
"tests/providers/openai/operators/test_openai.py" = ["E402"]
"tests/providers/openai/triggers/test_openai.py" = ["E402"]
"tests/providers/opensearch/conftest.py" = ["E402"]
"tests/providers/opensearch/hooks/test_opensearch.py" = ["E402"]
"tests/providers/opensearch/operators/test_opensearch.py" = ["E402"]
"tests/providers/openai/operators/test_openai.py" = ["E402"]
"tests/providers/qdrant/hooks/test_qdrant.py" = ["E402"]
"tests/providers/qdrant/operators/test_qdrant.py" = ["E402"]
"tests/providers/snowflake/operators/test_snowflake_sql.py" = ["E402"]
Expand Down
3 changes: 2 additions & 1 deletion tests/providers/openai/operators/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
from unittest.mock import Mock

import pytest
from openai.types.batch import Batch

openai = pytest.importorskip("openai")

from openai.types.batch import Batch

from airflow.exceptions import TaskDeferred
from airflow.providers.openai.operators.openai import OpenAIEmbeddingOperator, OpenAITriggerBatchOperator
from airflow.providers.openai.triggers.openai import OpenAIBatchTrigger
Expand Down
3 changes: 3 additions & 0 deletions tests/providers/openai/triggers/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
from unittest import mock

import pytest

openai = pytest.importorskip("openai")

from openai.types import Batch

from airflow.providers.openai.hooks.openai import BatchStatus
Expand Down

0 comments on commit c19986c

Please sign in to comment.