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

capital_gains_classifier fails when price is 0 #31

Open
scanta2 opened this issue Jan 2, 2025 · 1 comment
Open

capital_gains_classifier fails when price is 0 #31

scanta2 opened this issue Jan 2, 2025 · 1 comment

Comments

@scanta2
Copy link

scanta2 commented Jan 2, 2025

def reductions(entry):
        return [p for p in entry.postings if (p.cost and p.units.number and p.price)]

should be

def reductions(entry):
        return [p for p in entry.postings if (p.cost and p.units.number and p.price != None)]

or something like that (e.g. isinstance Amount). When price is 0, the if statement returns False.

@redstreet
Copy link
Owner

If you don't mind sending a PR with a unit test case, that'd make it a lot easier for me :)

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

No branches or pull requests

2 participants