chore: renaming error
This commit is contained in:
parent
d1bfeaa0f2
commit
fabbd638a4
2 changed files with 4 additions and 4 deletions
|
|
@ -45,11 +45,11 @@ class DatasetTypeError(CogneeValidationError):
|
|||
super().__init__(message, name, status_code)
|
||||
|
||||
|
||||
class InvalidAttributeError(CogneeValidationError):
|
||||
class InvalidTableAttributeError(CogneeValidationError):
|
||||
def __init__(
|
||||
self,
|
||||
message: str = "The provided data object is missing the required '__tablename__' attribute.",
|
||||
name: str = "InvalidAttributeError",
|
||||
name: str = "InvalidTableAttributeError",
|
||||
status_code: int = status.HTTP_400_BAD_REQUEST,
|
||||
):
|
||||
super().__init__(message, name, status_code)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from cognee.modules.data.exceptions.exceptions import InvalidAttributeError
|
||||
from cognee.modules.data.exceptions.exceptions import InvalidTableAttributeError
|
||||
from cognee.modules.data.models import Data
|
||||
from cognee.infrastructure.databases.relational import get_relational_engine
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ async def delete_data(data: Data):
|
|||
ValueError: If the data object is invalid.
|
||||
"""
|
||||
if not hasattr(data, "__tablename__"):
|
||||
raise InvalidAttributeError()
|
||||
raise InvalidTableAttributeError()
|
||||
|
||||
db_engine = get_relational_engine()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue