beanprice Error: Trim end date is before start date

30 views
Skip to first unread message

Ghanashyam Prabhu

unread,
Jan 30, 2021, 5:29:07 PM1/30/21
to Beancount
I see this error recently when I run beanprice --update --update-rate=daily on my beancount file. I don't recollect changing much on my beancount file. Below is the error message. What does 'Trim end date is before start date' error indicate?  

Traceback (most recent call last):
  File "/usr/local/bin/bean-price", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/beanprice/price.py", line 809, in main
    args, jobs, entries, dcontext = process_args()
  File "/usr/local/lib/python3.9/site-packages/beanprice/price.py", line 782, in process_args
    jobs.extend(get_price_jobs_up_to_date(entries,
  File "/usr/local/lib/python3.9/site-packages/beanprice/price.py", line 412, in get_price_jobs_up_to_date
    lifetimes.trim_intervals(intervals,
  File "/usr/local/lib/python3.9/site-packages/beancount/ops/lifetimes.py", line 120, in trim_intervals
    raise ValueError('Trim end date is before start date')
ValueError: Trim end date is before start date

Ghanashyam

Martin Blais

unread,
Jan 30, 2021, 10:03:21 PM1/30/21
to Beancount
There's a bug in beanprice.
This looks related to code submitted from a PR a little while ago that I copied over when I moved the repo.
A test is still missing:
--
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 beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/40dc70ea-83e8-4e58-9891-f0f8784f5f37n%40googlegroups.com.

Ghanashyam Prabhu

unread,
Jan 31, 2021, 12:13:27 PM1/31/21
to bean...@googlegroups.com
Interesting that it was working a week before. I am not an expert at debugging python but I'll give it a try.

Martin Blais

unread,
Jan 31, 2021, 12:26:36 PM1/31/21
to Beancount
Just means the inputs have changed.
I don't have time for a while, send me a patch if you find it.
Make sure you update too, I just merged a PR from @kris7t
Not sure if related.


Reply all
Reply to author
Forward
0 new messages