diff --git a/cognee/infrastructure/files/exceptions.py b/cognee/infrastructure/files/exceptions.py index eb6efdbce..351eaee9c 100644 --- a/cognee/infrastructure/files/exceptions.py +++ b/cognee/infrastructure/files/exceptions.py @@ -11,15 +11,3 @@ class FileContentHashingError(Exception): status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, ): super().__init__(message, name, status_code) - - -class UnsupportedPathSchemeError(Exception): - """Raised when a non-filesystem path scheme (like http://, https://) is passed to a function expecting filesystem paths.""" - - def __init__( - self, - message: str = "This function only supports filesystem paths (file:// or local paths), not HTTP/HTTPS URLs.", - name: str = "UnsupportedPathSchemeError", - status_code=status.HTTP_400_BAD_REQUEST, - ): - super().__init__(message, name, status_code) diff --git a/cognee/infrastructure/files/utils/get_data_file_path.py b/cognee/infrastructure/files/utils/get_data_file_path.py index d67fc95a0..7ffda79bd 100644 --- a/cognee/infrastructure/files/utils/get_data_file_path.py +++ b/cognee/infrastructure/files/utils/get_data_file_path.py @@ -1,8 +1,6 @@ import os from urllib.parse import urlparse -from cognee.infrastructure.files.exceptions import UnsupportedPathSchemeError - def get_data_file_path(file_path: str): # Check if this is a file URI BEFORE normalizing (which corrupts URIs) @@ -40,11 +38,6 @@ def get_data_file_path(file_path: str): return normalized_url - elif file_path.startswith(("http://", "https://")): - raise UnsupportedPathSchemeError( - message=f"HTTP/HTTPS URLs are not supported by get_data_file_path(). Received: {file_path}" - ) - else: # Regular file path - normalize separators normalized_path = os.path.normpath(file_path) diff --git a/cognee/modules/pipelines/operations/run_tasks_data_item.py b/cognee/modules/pipelines/operations/run_tasks_data_item.py index 9ddadd855..e445d323b 100644 --- a/cognee/modules/pipelines/operations/run_tasks_data_item.py +++ b/cognee/modules/pipelines/operations/run_tasks_data_item.py @@ -9,7 +9,6 @@ import os from typing import Any, Dict, AsyncGenerator, Optional from sqlalchemy import select -from cognee.infrastructure.files.exceptions import UnsupportedPathSchemeError import cognee.modules.ingestion as ingestion from cognee.infrastructure.databases.relational import get_relational_engine from cognee.infrastructure.files.utils.open_data_file import open_data_file diff --git a/cognee/tasks/ingestion/ingest_data.py b/cognee/tasks/ingestion/ingest_data.py index 648a34ace..e707f4d92 100644 --- a/cognee/tasks/ingestion/ingest_data.py +++ b/cognee/tasks/ingestion/ingest_data.py @@ -3,8 +3,6 @@ import inspect from uuid import UUID from typing import Union, BinaryIO, Any, List, Optional -from cognee.infrastructure.files.exceptions import UnsupportedPathSchemeError -from cognee.infrastructure.loaders import LoaderInterface import cognee.modules.ingestion as ingestion from cognee.infrastructure.databases.relational import get_relational_engine from cognee.modules.data.models import Data diff --git a/cognee/tasks/ingestion/save_data_item_to_storage.py b/cognee/tasks/ingestion/save_data_item_to_storage.py index d9b98268d..c70ddb2de 100644 --- a/cognee/tasks/ingestion/save_data_item_to_storage.py +++ b/cognee/tasks/ingestion/save_data_item_to_storage.py @@ -3,7 +3,6 @@ from pathlib import Path from urllib.parse import urlparse from typing import Union, BinaryIO, Any -from cognee.infrastructure.files.exceptions import UnsupportedPathSchemeError from cognee.modules.ingestion.exceptions import IngestionError from cognee.modules.ingestion import save_data_to_file from cognee.shared.logging_utils import get_logger