Skip to content

Commit 5480941

Browse files
committed
Improve metadata error message to identify the error
Improve metadata error message to identify the error
1 parent 40ddd84 commit 5480941

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pydough/errors/error_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def verify(self, obj: object, error_name: str) -> None:
8989
`PyDoughMetadataException`: if `obj` did not satisfy the predicate.
9090
"""
9191
if not self.accept(obj):
92+
error_name = f"{error_name}: [{repr(obj)}]"
9293
raise PyDoughMetadataException(self.error_message(error_name))
9394

9495

@@ -101,7 +102,7 @@ def accept(self, obj: object) -> bool:
101102
return isinstance(obj, str) and obj.isidentifier()
102103

103104
def error_message(self, error_name: str) -> str:
104-
return f"{error_name} must be a string that is a Python identifier"
105+
return f"{error_name} must be a string that is a valid Python identifier"
105106

106107

107108
class NoExtraKeys(PyDoughPredicate):

pydough/metadata/graphs/graph_metadata.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def __init__(
4343
synonyms: list[str] | None,
4444
extra_semantic_info: dict | None,
4545
):
46+
breakpoint()
4647
is_valid_name.verify(name, "graph name")
4748
self._additional_definitions: list[str] | None = additional_definitions
4849
self._verified_pydough_analysis: list[dict] | None = verified_pydough_analysis

0 commit comments

Comments
 (0)