1
0

Fix bug handling ptags in hledger output

Actual output from hledger is a list of tuples.
This commit is contained in:
Tony Grosinger 2022-07-23 08:30:20 -07:00
parent 33c1e9eb9d
commit ea6e328bfb
3 changed files with 3 additions and 3 deletions

View File

@ -12,4 +12,4 @@ ENV LEDGER_FILE=/data/all.ledger
ENV OUTPUT_FILE=/data/all.sqlite
ENV OVERWRITE_OUTPUT=true
ENTRYPOINT ["python", "/code/export.py"]
ENTRYPOINT ["python", "/code/main.py"]

View File

@ -130,7 +130,7 @@ def write_transactions(cursor: sqlite3.Cursor, txs: List[Transaction]) -> None:
posting.get("paccount"),
get_posting_amount(posting),
posting.get("pstatus"),
",".join(posting.get("ptags") or []),
",".join([":".join(x) for x in posting.get("ptags") or []]),
posting.get("pcomment"),
],
)

View File

@ -34,7 +34,7 @@ class Posting(typing.TypedDict):
pdate2: str | None
poriginal: str | None
pstatus: str # TODO: Enum?
ptags: List[str]
ptags: List[List[str]]
ptransaction_: int
ptype: str # TODO: Enum?