Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting location fails for entries created out of pad directive #192

Closed
tarioch opened this issue Jun 21, 2024 · 1 comment
Closed

Selecting location fails for entries created out of pad directive #192

tarioch opened this issue Jun 21, 2024 · 1 comment

Comments

@tarioch
Copy link

tarioch commented Jun 21, 2024

If you have pad statements, the location query doesn't work as the meta is missing

If you have something like

2024-01-01 open Assets:Foo
2024-01-01 open Income:Bar
2024-01-01 open Equity:Clear

2024-01-02 * "Add something"
    Assets:Foo  1 CHF
    Income:Bar

2024-01-03 pad Assets:Foo Equity:Clear
2024-01-04 balance Assets:Foo                         0 CHF

and run a query like

select account, location

It results in

  File "/workspace/.venv/lib/python3.10/site-packages/beanquery/query_env.py", line 1039, in location
    return '{:s}:{:d}:'.format(meta['filename'], meta['lineno'])
KeyError: 'filename'

this used to work on beancount 2

@dnicolodi
Copy link
Collaborator

This bug had something familiar to it... And indeed I fixed it once already beancount/beancount#767 And a fix for generating transactions with metadata went into beancount v2 beancount/beancount#768 but apparently it never made into beancount v3

I'll add another work-around for this in beanquery.

dnicolodi added a commit to dnicolodi/beanquery that referenced this issue Jun 21, 2024
dnicolodi added a commit to dnicolodi/beanquery that referenced this issue Jun 21, 2024
dnicolodi added a commit to dnicolodi/beanquery that referenced this issue Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants