From 6e772f54c6e5115f48cbb3e20c2c1cf6fb38654e Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Mon, 17 Jun 2024 14:33:33 -0300 Subject: [PATCH] refactor: Ignore Pydantic deprecation warning when building component --- src/backend/base/langflow/interface/initialize/loading.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/base/langflow/interface/initialize/loading.py b/src/backend/base/langflow/interface/initialize/loading.py index 44a8db718..841aaaf1f 100644 --- a/src/backend/base/langflow/interface/initialize/loading.py +++ b/src/backend/base/langflow/interface/initialize/loading.py @@ -123,8 +123,9 @@ async def build_component( ): # Now set the params as attributes of the custom_component custom_component.set_attributes(params) - warnings.filterwarnings("ignore", category=PydanticDeprecatedSince20) - build_results, artifacts = await custom_component.build_results(vertex) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=PydanticDeprecatedSince20) + build_results, artifacts = await custom_component.build_results(vertex) return custom_component, build_results, artifacts