Clean up - remove UnsupportedPathSchemeError
This commit is contained in:
parent
35d3c08779
commit
085e81c082
5 changed files with 0 additions and 23 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue