New issue 335: BQL: None should be considered False in boolean context
https://bitbucket.org/blais/beancount/issues/335/bql-none-should-be-considered-false-in
Stefano Zacchiroli:
The following query:
```
#!bql
SELECT ANY_META('trip') AS trip, SUM(position) AS amount
WHERE account ~ '^Assets:Reimbursable'
AND ANY_META('trip')
GROUP BY trip
```
when 'trip' might be missing from some transaction fails as follows:
```
#!python
File
"/home/zack/.local/lib/python3.6/site-packages/beancount/query/query_compile.py",
line 121, in __call__
return self.operator(self.left(context), self.right(context))
TypeError: unsupported operand type(s) for &: 'bool' and 'str'
```
the string in question is probably "None", i.e., the string representation of
Python None values.
It would be nice if missing metadata could be treated as False in boolean
context by BQL.
--
You received this message because you are subscribed to the Google Groups
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beancount/20180929053838.13445.84772%40celery-worker-112.ash1.bb-inf.net.
For more options, visit https://groups.google.com/d/optout.