Skip to content

Commit 90da0cf

Browse files
Apply suggestions from code review
Co-authored-by: Copilot <[email protected]>
1 parent 91df253 commit 90da0cf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python/egglog/declarations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def __egg_decls__(self) -> Declarations:
9696
# Catch attribute error, so that it isn't bubbled up as a missing attribute and fallbacks on `__getattr__`
9797
# instead raise explicitly
9898
except AttributeError as err:
99-
msg = f"Cannot resolve declarations {err}"
99+
msg = f"Cannot resolve declarations for {self}: {err}"
100100
raise RuntimeError(msg) from err
101101

102102

@@ -345,7 +345,7 @@ class ClassTypeVarRef:
345345

346346
def to_just(self, vars: dict[ClassTypeVarRef, JustTypeRef] | None = None) -> JustTypeRef:
347347
if vars is None or self not in vars:
348-
raise TypeVarError(f"Cannot convert {self} to just type")
348+
raise TypeVarError(f"Cannot convert type variable {self} to concrete type without variable bindings")
349349
return vars[self]
350350

351351
def __str__(self) -> str:

python/egglog/runtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def __call__(self, *args: object, _egg_partial_function: bool = False, **kwargs:
380380
try:
381381
bound = py_signature.bind(*args, **kwargs)
382382
except TypeError as err:
383-
raise TypeError(f"Wrong number of arguments for {self} with args {args} and kwargs {kwargs}") from err
383+
raise TypeError(f"Failed to bind arguments for {self} with args {args} and kwargs {kwargs}: {err}") from err
384384
del kwargs
385385
bound.apply_defaults()
386386
assert not bound.kwargs

0 commit comments

Comments
 (0)