Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Membership operator with None causes typerror. #21

Open
Onager opened this issue Jul 18, 2016 · 0 comments
Open

Membership operator with None causes typerror. #21

Onager opened this issue Jul 18, 2016 · 0 comments

Comments

@Onager
Copy link

Onager commented Jul 18, 2016

This query:

IfElse(
Union(Membership(
 Literal('last message repeated')
 Var('body')))
Literal('repeated')
Literal(None))

Causes a TypeError when the "body" var is None. Stacktrace:

  File "/usr/lib/python2.7/dist-packages/efilter/api.py", line 125, in apply
    results = solve.solve(query, vars).value
  File "/usr/lib/python2.7/dist-packages/efilter/dispatch.py", line 193, in __call__
    return implementation(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/efilter/transforms/solve.py", line 208, in solve_query
    return solve(query.root, vars)
  File "/usr/lib/python2.7/dist-packages/efilter/dispatch.py", line 193, in __call__
    return implementation(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/efilter/transforms/solve.py", line 403, in solve_ifelse
    if boolean.asbool(solve(condition, vars).value):
  File "/usr/lib/python2.7/dist-packages/efilter/dispatch.py", line 193, in __call__
    return implementation(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/efilter/transforms/solve.py", line 644, in solve_union
    result = solve(child, vars)
  File "/usr/lib/python2.7/dist-packages/efilter/dispatch.py", line 193, in __call__
    return implementation(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/efilter/transforms/solve.py", line 771, in solve_membership
    return Result(needle in values, ())
  File "/usr/lib/python2.7/dist-packages/efilter/transforms/solve.py", line 162, in __solve_and_destructure_repeated
    values = iter(__solve_for_repeated(expr, vars))
TypeError: 'NoneType' object is not iterable
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant