-
Notifications
You must be signed in to change notification settings - Fork 30
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
Handle unknown accounts and split transfers #97
Conversation
commit b1af53f Author: lcmcninch <[email protected]> Date: Sun Nov 3 09:05:39 2024 -0500 Add test case for unknown account type. commit 156586e Merge: 254a0e7 3167670 Author: lcmcninch <[email protected]> Date: Sun Nov 3 07:53:39 2024 -0500 Merge branch 'main' into handle_unknown_account_type commit 254a0e7 Author: lcmcninch <[email protected]> Date: Sun Nov 3 07:04:09 2024 -0500 Handle unknown account types Add and "Unknown" to the `AccountType` enum and apply that type to any incoming account type that is not already in the enum.
# Conflicts: # tests/test_qif.py
@isaacharrisholt I'm not sure what happened with the tests on this one. Everything passes in my 3.12 environment, and I'm pretty sure the failures in 3.11 aren't related to the changes in this PR. Do you have any more insight? EDIT: I set up a 3.11 environment and was able to replicate the failures. I'll dig into it and see what I can figure out. |
…12 versions of python.
@isaacharrisholt Apologies, those failures were on me. I think I got it sorted. We're still getting the virtualenv failure in the windows 3.9 test discussed in a comment on a previous PR. But otherwise I think we're good to go now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking so long to get back to you on this. I can see no issues with these changes - thanks again for your contribution!
No worries, thanks for accepting it! |
This PR addresses two issues:
Split Transfers
Issue #95 is fairly straightforward. We just need to detect and handle transfers in split transactions. This means that when a split transaction category is in brackets (e.g.
[Savings]
), this value should be assigned toSplit.to_account
rather thanSplit.category
. See the associated issue for more detail.Unknown Account Types
Issue #94 is a bit more tricky. I think this situation relates to the
!Option:AutoSwitch
section of the QIF file that isn't well defined. The associated issue has more detail, but in summary: sometimes accounts have types that aren't defined in theAccountType
enum. To handle this situation, a fallback mechanism is implemented that assigns these accounts an 'unknown' type, ensuring the parser remains functional when this situation is encountered. It doesn't seem ideal, and perhaps we'll find a better solution in the future. But this addresses pydantic failures when reading files with these unknown account types. It is left to the user to detect and fix the unknown types on their end if they desire.