Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean exceptions
Browse files Browse the repository at this point in the history
a-s-g93 committed Oct 16, 2024
1 parent dfe0ade commit 18e9d1e
Showing 2 changed files with 2 additions and 44 deletions.
42 changes: 0 additions & 42 deletions neo4j_runway/exceptions.py
Original file line number Diff line number Diff line change
@@ -77,45 +77,3 @@ class NonuniqueNodeError(RunwayPydanticValidationError):
"""Exception raised when a node has no unique properties."""

pass


class InvalidColumnMappingError(RunwayPydanticValidationError):
"""Exception raised when a property is mapped to either a missing or invalid column."""

pass


class MissingSourceNodeError(RunwayPydanticValidationError):
"""Exception raised when a relationship has a source node that is not present in the data model."""

pass


class MissingTargetNodeError(RunwayPydanticValidationError):
"""Exception raised when a relationship has a target node that is not present in the data model."""

pass


class SameSourceAndTargetNodeWithNoAliasError(RunwayPydanticValidationError):
"""Exception raised when a relationship has source and target nodes with the same label, but there is no unique property alias named."""

pass


class PropertyAliasNotFoundInFileError(RunwayPydanticValidationError):
"""Exception raised when a relationship and its source or target node are from different files and the unique node property alias is not found in the node source file."""

pass


class PropertyAliasMissingError(RunwayPydanticValidationError):
"""Exception raised when a relationship and its source or target node are from different files and the unique node property has no named alias."""

pass


class SharedColumnMappingError(RunwayPydanticValidationError):
"""Exception raised when a property column mapping is shared between many nodes or relationships."""

pass
4 changes: 2 additions & 2 deletions neo4j_runway/llm/base.py
Original file line number Diff line number Diff line change
@@ -184,7 +184,7 @@ def _get_initial_data_model_response(

print("Received Valid Initial Nodes.")
except InstructorRetryException as e:
print("Invalid `Nodes` returned.")
print("Invalid Nodes returned.")
# return model without validation
nodes: Nodes = Nodes.model_construct( # type: ignore
json.loads(
@@ -259,7 +259,7 @@ def _get_data_model_response(
**self.model_params,
)
except InstructorRetryException as e:
print("Invalid `DataModel` returned.")
print("Invalid Data Model returned.")
# return model without validation
return DataModel.model_construct(
json.loads(

0 comments on commit 18e9d1e

Please sign in to comment.