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

Error while parsing Coinbase records #408

Open
dipunm opened this issue Dec 20, 2024 · 1 comment
Open

Error while parsing Coinbase records #408

dipunm opened this issue Dec 20, 2024 · 1 comment
Assignees
Labels
bug Something isn't working data file update Correction to an existing data file format

Comments

@dipunm
Copy link

dipunm commented Dec 20, 2024

I installed the latest version using

pipx install git+https://github.com/BittyTax/BittyTax

(Using Arch Linux, hence pipx)

I get this error:

Traceback (most recent call last):
  File "/home/dipunm/.local/bin/bittytax_conv", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/dipunm/.local/share/pipx/venvs/bittytax/lib/python3.12/site-packages/bittytax/conv/bittytax_conv.py", line 140, in main
    _do_read_file(file_type, pathname, args)
  File "/home/dipunm/.local/share/pipx/venvs/bittytax/lib/python3.12/site-packages/bittytax/conv/bittytax_conv.py", line 194, in _do_read_file
    DataFile.read_csv(pathname, args)
  File "/home/dipunm/.local/share/pipx/venvs/bittytax/lib/python3.12/site-packages/bittytax/conv/datafile.py", line 274, in read_csv
    data_file.parse(
  File "/home/dipunm/.local/share/pipx/venvs/bittytax/lib/python3.12/site-packages/bittytax/conv/datafile.py", line 94, in parse
    data_row.parse(self.parser, **kwargs)
  File "/home/dipunm/.local/share/pipx/venvs/bittytax/lib/python3.12/site-packages/bittytax/conv/datarow.py", line 43, in parse
    parser.row_handler(self, parser, **kwargs)
  File "/home/dipunm/.local/share/pipx/venvs/bittytax/lib/python3.12/site-packages/bittytax/conv/parsers/coinbase.py", line 39, in parse_coinbase_v4
    subtotal_ccy = DataParser.convert_currency(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dipunm/.local/share/pipx/venvs/bittytax/lib/python3.12/site-packages/bittytax/conv/dataparser.py", line 182, in convert_currency
    if not Decimal(value):
           ^^^^^^^^^^^^^^
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]

I believe it to be due to a negative value starting with .

Here is the line with amount redacted:

conv: row[7] ['617bbb67b52bb0f0f362f0d7', '2022-00-00 00:00:00 UTC', 'Exchange Deposit', 'GBP', '-000', 'GBP', '£1.00', '-£000.00', '-£000.00', '£0.00', 'Deposited -000 GBP into GDAX']

I suspect it is because .strip("£€$") does not do what it is expected to do on a negative number.

@nanonano
Copy link
Member

Hi @dipunm, thanks for raising this. I've done a fix, see 5400dee. Please re-test.

@nanonano nanonano self-assigned this Dec 20, 2024
@nanonano nanonano added bug Something isn't working data file update Correction to an existing data file format labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working data file update Correction to an existing data file format
Projects
None yet
Development

No branches or pull requests

2 participants