-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: add support for use in importer hooks #16
base: main
Are you sure you want to change the base?
Conversation
bb2c0c2
to
f23f0c9
Compare
@maread99 The third commit is just necessary a necessary fix so that I can operate |
784a4d9
to
a934786
Compare
Hi @blaggacao. Thank you for this PR. Much appreciated! I don't think I'm not going to get a chance to have a good look before next week. I will do then if not before. I ran the tests although it's being pulled up on the linting. Cheers |
0e3bf92
to
b3fd1a1
Compare
@maread99 Ok, I ensured linting, cleaned up the history and use this -as is- in my own production, now. Thanks for considering this contribution! You could also cherry-pick the first commit as an independent fix. |
This solves the problem of incompatible account names errors as soon as one of the secified options set a different base account name, which currently renders beanahead incompatible with the use of those options
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.
Thanks again for this @blaggacao. I've had a look, am grateful for the PR and in principle more than happy to merge the new functionality.
I've made a few comments and requests for info / changes. A few of the tests are failing although at least some should come good if the points I've raised are addressed.
Cheers
RootAccountsContext = {} # global context | ||
|
||
|
||
def set_root_accounts_context(path_ledger: str) -> dict[str]: |
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.
Would you mind adding a simple test to verify that all's working as expected when users are using non-default category names?
from .errors import BeanaheadWriteError | ||
|
||
|
||
class ReconcileExpected: |
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.
Could a simple test be added to verify the hook is working as intended?
For the tests:
|
To a fresh (or existing) python environment (>=3.9) you could install the current version with the optional 'dev' dependencies:
Then uninstall beanahead:
And install your fork. If you have your fork installed locally then from the project directory (containing
Otherwise:
Or, I'd have thought you might(?) be able to do the whole lot with either:
or
As for the tests, yup, pytest. (I use VSCode which nicely integrates both the creation of environments and testing with pytest.) |
Moves all remaining output to stderr. Also changes `RootAccountsContext` to only include names that are non-default.
Hi @blaggacao, I've added a commit which gets all the existing tests passing. If, when you can, you could add tests to cover the new functionality and then I think we'll be good to merge. Cheers |
Thank you for the additions! I've high load, atm, and will ll try to revisit next week. |
Hi @blaggacao I've made some changes to make In any event, I think I'm leaning towards not implementing the
These changes are included in the new v0.3 release. The new Options section of the README provides the documentation together with the note at the end of the Making beanahead files section. I was thinking it might be best if you publish the hook yourself and we include a reference and link on the README here? With the changes above now made I'd have thought this could be pretty simple? Let me know what you think. Cheers |
Hey, this sounds great! For expectation management, my setup is currently working and I won't touch it in a while (maybe a year or so). But I've taken note and will seek an occasion to conform to your suggestion, which I agree with and find reasonable. Let's maybe keep this open just for reference, in the meantime? (Just for the sake of not burying it inside the "closed" stack of PRs). |
Great, let me know if/when you do set something up and we can add a reference and link to the README here. I'll leave this PR open in the meantime. |
Context