New issue 242: unorderable types: NoneType() < datetime.date() / 'BQLShell' object has no attribute 'do_SELECT'
https://bitbucket.org/blais/beancount/issues/242/unorderable-types-nonetype-datetimedate
Martin Michlmayr:
I forgot to convert something from ledger's XX @@ FOO to XX {FOO} syntax and got the following error in bean-query. (I originally found the problem because fava crashed. Below is a simplified query.)
```
beancount> SELECT account WHERE account_sortkey(account) ~ "^[01]" GROUP BY account, cost_date, currency, account_sortkey(account) ORDER BY account_sortkey(account), cost_date
Traceback (most recent call last):
File "/usr/lib/python3.5/cmd.py", line 214, in onecmd
func = getattr(self, 'do_' + cmd)
AttributeError: 'BQLShell' object has no attribute 'do_SELECT'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/query/shell.py", line 266, in run_parser
self.dispatch(statement)
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/query/shell.py", line 246, in dispatch
return method(statement)
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/query/shell.py", line 414, in on_Select
self.options_map)
File "/home/tbm/.local/lib/python3.5/site-packages/beancount/query/query_execute.py", line 328, in execute_query
reverse=(query.ordering == 'DESC'))
TypeError: unorderable types: NoneType() < datetime.date()
beancount>
```
Test case:
```
2010-01-01 open Equity:Opening-Balance
2010-01-01 open Assets:Pension:NEST
2018-01-01 * "Opening balance: NEST"
Assets:Pension:NEST 57.62 GBP
Equity:Opening-Balance
2018-01-01 * "Opening balance: NEST Higher Risk Fund"
fund: "NESTHIGHER"
Assets:Pension:NEST 11.7230 NESTHIGHER {{25.61 GBP, 2017-12-14}}
Equity:Opening-Balance
2018-01-02 * "NEST: Bought NEST Higher Risk Fund with December employee contributions"
fund: "NESTHIGHER"
Assets:Pension:NEST 11.7520 NESTHIGHER @@ 25.61 GBP
Assets:Pension:NEST -25.61 GBP
```