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

Handle unknown accounts and split transfers #97

Merged
merged 7 commits into from
Nov 12, 2024

Conversation

lcmcninch
Copy link
Contributor

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 to Split.to_account rather than Split.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 the AccountType 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.

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
@lcmcninch lcmcninch marked this pull request as ready for review November 3, 2024 14:36
@lcmcninch
Copy link
Contributor Author

lcmcninch commented Nov 10, 2024

@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.

@lcmcninch
Copy link
Contributor Author

@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.

Copy link
Owner

@isaacharrisholt isaacharrisholt left a 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!

@isaacharrisholt isaacharrisholt merged commit a87df4a into isaacharrisholt:main Nov 12, 2024
11 of 12 checks passed
@lcmcninch
Copy link
Contributor Author

No worries, thanks for accepting it!

@lcmcninch lcmcninch deleted the is_94_95 branch November 13, 2024 00:19
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

Successfully merging this pull request may close these issues.

2 participants