From 7ea38acf2dc237104f7a576fed9f392e22049991 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 22 Nov 2024 16:24:12 -0500 Subject: [PATCH] x --- libs/core/tests/unit_tests/runnables/test_runnable.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/core/tests/unit_tests/runnables/test_runnable.py b/libs/core/tests/unit_tests/runnables/test_runnable.py index d1f67a6c8d9..8e34c7873e4 100644 --- a/libs/core/tests/unit_tests/runnables/test_runnable.py +++ b/libs/core/tests/unit_tests/runnables/test_runnable.py @@ -87,6 +87,7 @@ from langchain_core.tracers import ( RunLogPatch, ) from langchain_core.tracers.context import collect_runs +from langchain_core.utils.pydantic import PYDANTIC_MAJOR_VERSION, PYDANTIC_MINOR_VERSION from tests.unit_tests.pydantic_utils import _normalize_schema, _schema from tests.unit_tests.stubs import AnyStr, _any_id_ai_message, _any_id_ai_message_chunk @@ -223,6 +224,13 @@ class FakeRetriever(BaseRetriever): return [Document(page_content="foo"), Document(page_content="bar")] +@pytest.mark.skipif( + (PYDANTIC_MAJOR_VERSION, PYDANTIC_MINOR_VERSION) >= (2, 10), + reason=( + "Only test with most recent version of pydantic. " + "Pydantic introduced small fixes to generated JSONSchema on minor versions." + ), +) def test_schemas(snapshot: SnapshotAssertion) -> None: fake = FakeRunnable() # str -> int