Skip to content

Commit 34b8eff

Browse files
committed
fix: handle None constraints
1 parent 7724a54 commit 34b8eff

File tree

1 file changed

+3
-3
lines changed
  • src/neo4j_graphrag/experimental/components

1 file changed

+3
-3
lines changed

src/neo4j_graphrag/experimental/components/schema.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,13 @@ def validate_constraints_against_node_types(self) -> Self:
261261
if not self.constraints:
262262
return self
263263
for constraint in self.constraints:
264-
if not constraint.get("property_name"):
264+
if not constraint.property_name:
265265
raise SchemaValidationError(
266266
f"Constraint has no property name: {constraint}. Property name is required."
267267
)
268-
if constraint.get("node_type") not in self._node_type_index:
268+
if constraint.node_type not in self._node_type_index:
269269
raise SchemaValidationError(
270-
f"Constraint references undefined node type: {constraint.get('node_type')}"
270+
f"Constraint references undefined node type: {constraint.node_type}"
271271
)
272272
return self
273273

0 commit comments

Comments
 (0)