Closed johanvanl closed 4 months ago
@chrislemaire , would you have time to look into this (and #2178) ? Seems like possibly a weakness in #1989.
Same issue as #2178 which was logged just after, after looking at that issue, my issue can be simplified even further.
Journal
2023-12-26
assets:day_to_day_accounts:bank -200
expenses:housing:rent
2024-01-26
assets:day_to_day_accounts:bank -200
expenses:housing:rent
Print Command works
hledger -f finances.hledger print expr:"date:..2024-01-01 OR date:2024-01-01..tomorrow"
IS Command doesn't work
hledger -f finances.hledger is expr:"date:..2024-01-01 OR date:2024-01-01..tomorrow"
Notes:
( DateSpan 2024, [ DateSpan 2024 ] )
for a query like expr:'date:..2024 or date:2024'
. Ie it thinks the overall report span is 2024 but it should be "..2025".To work around: specify both ends of the date: periods when using OR.
Fixed in master. Hledger.Data.Date's spanUnion
has always been wrong with open-ended date spans; now there's both spanUnion
and spanExtend
.
Thanks for the report!
Logging a bug from a discussion I posted on the HLedger Google Groups.
Simplifying the example even more.
Version I am running:
hledger 1.32.2-g47d26d99a-20240105, windows-x86_64
Sample Journal:
I have an expression that should return any 'expense' from 2024, and only 'expenses:housing:rent' from previous years. As follows:
This should return all the transactions from the example Journal except for the one 'expenses:day_to_day:food' transaction from 2023.
Which is what print does, if running as follows:
As follows:
The other commands (I originally picked up the issue using
is
, butreg
shows the issue even better), besides print, only picks up the 2 transactions from 2024. For example, register:Outputs:
Why is the expression interpreted differently for different commands?