-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add AnonymousExprError
#1816
Conversation
msg = ".over" | ||
raise AnonymousExprError.from_expr_name(msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruff would still complain if we don't move the string to a separate variable
awesome, thanks! i think it's fine to now move this up - in theory, I don't see why we should be raising this error at all, i think for now it's fine to just raise the error at the compliant level |
Do you mean that we should start supporting this or that we should let the backends raise their own errors?
I tried to do something like this: class ExprNameNamespace:
...
def keep(self: Self) -> ExprT:
def _func(plx):
compliant_expr = self._expr._to_compliant_expr(plx)
if compliant_expr._root_names is None:
raise AnonymousExprError.from_expr_name(".name.keep")
return compliant_expr.name.keep()
return self._expr.__class__(_func) but |
I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @EdAbati !
What type of PR is this? (check all applicable)
Related issues
Checklist
If you have comments or can explain your changes, please do so below
I propose to add a error for the (very) common error message about anonlymous expressions.
Ideally I would like to move this a level up (since we raise it for every backend) but I get all sorts of mypy error if I do that. e.g.
mypy
thinksroot_names
could still beNone