diff --git a/llama-index-core/llama_index/core/ingestion/data_sinks.py b/llama-index-core/llama_index/core/ingestion/data_sinks.py index 9a1b88b05803e..814d6038b48c0 100644 --- a/llama-index-core/llama_index/core/ingestion/data_sinks.py +++ b/llama-index-core/llama_index/core/ingestion/data_sinks.py @@ -1,7 +1,12 @@ from enum import Enum from typing import Generic, Type, TypeVar -from llama_index.core.bridge.pydantic import BaseModel, Field, GenericModel +from llama_index.core.bridge.pydantic import ( + BaseModel, + Field, + GenericModel, + ValidationError, +) from llama_index.core.vector_stores.types import BasePydanticVectorStore @@ -66,7 +71,7 @@ def build_configured_data_sink( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -83,7 +88,7 @@ def build_configured_data_sink( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -100,7 +105,7 @@ def build_configured_data_sink( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -117,7 +122,7 @@ def build_configured_data_sink( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -134,7 +139,7 @@ def build_configured_data_sink( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass return ConfigurableComponent("ConfigurableDataSinks", enum_members) diff --git a/llama-index-core/llama_index/core/ingestion/data_sources.py b/llama-index-core/llama_index/core/ingestion/data_sources.py index fde18413e6a52..2f6f216546e05 100644 --- a/llama-index-core/llama_index/core/ingestion/data_sources.py +++ b/llama-index-core/llama_index/core/ingestion/data_sources.py @@ -3,7 +3,12 @@ from pathlib import Path from typing import Any, Generic, Iterable, List, Optional, Type, TypeVar, cast -from llama_index.core.bridge.pydantic import BaseModel, Field, GenericModel +from llama_index.core.bridge.pydantic import ( + BaseModel, + Field, + GenericModel, + ValidationError, +) from llama_index.core.readers.base import BasePydanticReader, ReaderConfig from llama_index.core.schema import BaseComponent, Document, TextNode @@ -103,7 +108,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -120,7 +125,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -135,7 +140,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -150,7 +155,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -167,7 +172,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -182,7 +187,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -197,7 +202,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -214,7 +219,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -229,7 +234,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -244,7 +249,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -261,7 +266,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -276,7 +281,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -291,7 +296,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -306,7 +311,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -323,7 +328,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -338,7 +343,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -353,7 +358,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -370,7 +375,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -387,7 +392,7 @@ def build_configured_data_source( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass enum_members.append( diff --git a/llama-index-core/llama_index/core/ingestion/transformations.py b/llama-index-core/llama_index/core/ingestion/transformations.py index 15e13d9983aa4..6b43d9e009197 100644 --- a/llama-index-core/llama_index/core/ingestion/transformations.py +++ b/llama-index-core/llama_index/core/ingestion/transformations.py @@ -5,7 +5,12 @@ from enum import Enum from typing import Generic, Sequence, Type, TypeVar -from llama_index.core.bridge.pydantic import BaseModel, Field, GenericModel +from llama_index.core.bridge.pydantic import ( + BaseModel, + Field, + GenericModel, + ValidationError, +) from llama_index.core.node_parser import ( CodeSplitter, HTMLNodeParser, @@ -222,7 +227,7 @@ def build_configured_transformation( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -240,7 +245,7 @@ def build_configured_transformation( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass try: @@ -258,7 +263,7 @@ def build_configured_transformation( ), ) ) - except ImportError: + except (ImportError, ValidationError): pass return ConfigurableComponent("ConfigurableTransformations", enum_members)