Conversation
…org#350) Signed-off-by: SAY-5 <say.apm35@gmail.com>
|
Good catch. Could you maybe add a full test for an "Aktien erhalten" event? |
|
Sure. I don't have a real 'Aktien erhalten' payload handy. From #350's traceback it looks like the original event had eventType=null and the title 'AI & Big Data USD (Acc) Aktien erhalten'. Do you have a sanitized fixture I can drop into tests/aktien_erhalten*.json, or is the existing aktiensplit_no_eventType.json (which already carries the 'Du hast Aktien aus einer Kapitalmaßnahme erhalten' header) close enough to repurpose? |
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
|
Added an |
|
Again, thanks for the contribution. As I made a lot of refacturing changes, the issue should be gone in the meanwhile. Added a regression test through #388. Hence closing this PR. |
Closes #350.
_parse_card_notereadsevent_dict.get("eventType", ""), butdict.get(k, default)only returns the default when the key is absent. The Trade Republic timeline includes "Aktien erhalten" (shares-received) entries where the key is present with valuenull, soeventTypeStrbecomesNoneand the next line'seventTypeStr.startswith("card_")nil-derefs, breakingpytr export_transactionsCSV export end-to-end.Replaces the default with
event_dict.get("eventType") or ""so both missing and null collapse to an empty string. Regression testtest_parse_card_note_returns_none_when_event_type_is_nullcovers the null case (the bug repro), the existing absent case, and the existing card_-prefix happy path.