Skip to content
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

Inconsistent expression parsing #102

Open
michal-klimek opened this issue Feb 1, 2024 · 0 comments
Open

Inconsistent expression parsing #102

michal-klimek opened this issue Feb 1, 2024 · 0 comments

Comments

@michal-klimek
Copy link

Hello, there is a problem with the BoolOperand.__new__ method. The returned operand would not properly work in such a case:

  1. Make a custom policy condition checking method, i.e. check_something.
  2. Use it in a form: check_something:{parent}.attribute_one.attribute_two inside a statement's condition and it works.
  3. Use it again in a condition_expression in a form not check_something:{parent}.attribute_one.attribute_two and it will silently fail, because characters like { and } are not recognized properly.

return TRUE | FALSE | Word(alphanums + '_:.*', max=256)

It should rather be:

class BoolOperand(object):
    def __new__(cls):
        return TRUE | FALSE | Combine(Word(alphanums + "_", max=256) + ":" + Word(printables, max=256))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant