Skip to content

Typed metadata not handled on commodities #271

Open
@zacchiro

Description

Typed metadata are handled like regular metadata (and hence always rendered as string literals) when used on commodities (at least), whereas they work properly on transactions.

For example, the following ledger snippet:

commodity EUR
    note Euro
    format 1000.00 EUR
    ; normal_metadata: 42.0
    ; typed_metadata:: 42.0

2025-01-21 * salary
    ; normal_metadata: 42.0
    ; typed_metadata:: 42.0
    Income:Salary                                               -1000.00 EUR
    Assets:Checking                                              1000.00 EUR

is translated by ledger2beancount to the following beancount snippet:

1970-01-01 commodity EUR
    name: "Euro"
    normal_metadata: "42.0"
    typed_metadata: "42.0"

2025-01-21 * "salary"
    normal_metadata: "42.0"
    typed_metadata: 42.0
    Income:Salary                                               -1000.00 EUR
    Assets:Checking                                              1000.00 EUR

Note the (incorrect) double quotes around typed_metadata value in the EUR commodity, which are (correctly) missing in the transaction case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions