Issue #345: bsql: unsupported operand type(s) for &: 'NoneType' and 'bool' (blais/beancount)

6 views
Skip to first unread message

Martin Michlmayr

unread,
Dec 12, 2018, 7:00:20 PM12/12/18
to bean...@googlegroups.com
New issue 345: bsql: unsupported operand type(s) for &: 'NoneType' and 'bool'
https://bitbucket.org/blais/beancount/issues/345/bsql-unsupported-operand-type-s-for

Martin Michlmayr:

I can do this to make sure metadata does NOT exist:

```
beancount> SELECT account WHERE NOT ANY_META('program');

```

If I drop the `NOT`, it also works fine:

```
beancount> SELECT account WHERE ANY_META('program');

```

However, this fails:

```
beancount> SELECT account WHERE ANY_META('program') AND NOT ANY_META('entity');
...
return self.operator(self.left(context), self.right(context))
TypeError: unsupported operand type(s) for &: 'NoneType' and 'bool'
```

It doesn't make sense that it works on its own but not when combined with another query of the same type.

As a workaround, `ANY_META('program') ~ '' AND...` it works; but I think the simple query should work.


Reply all
Reply to author
Forward
0 new messages