Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Latest Ledger CSV Exports Changed Indices - New Status Column #275

Open
librethanks opened this issue Dec 30, 2024 · 0 comments
Open

Latest Ledger CSV Exports Changed Indices - New Status Column #275

librethanks opened this issue Dec 30, 2024 · 0 comments

Comments

@librethanks
Copy link

I got the following error when trying to run with the latest Ledger Live exports.

ERROR: Fatal exception occurred:
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.10/site-packages/dali/dali_main.py", line 168, in _dali_main_internal
    result_list = pool.map(_input_plugin_helper, input_plugin_args_list)
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/home/user/.local/lib/python3.10/site-packages/dali/dali_main.py", line 226, in _input_plugin_helper
    plugin_transactions = input_plugin.load(country)
  File "/home/user/.local/lib/python3.10/site-packages/dali/plugin/input/csv/ledger.py", line 107, in load
    quantity_number: RP2Decimal = RP2Decimal(line[self.__QUANTITY_INDEX])
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]

I was able to fix it by removing the status column from the new csv exports.

The new header in the ledger csv export is the following:

Operation Date, Status, Currency Ticker, Operation Type, Operation Amount, Operation Fees, Operation Hash, Account Name, Account xpub, Countervalue Ticker, Countervalue at Operation Date, Countervalue at CSV Export

I believe the code at:

class InputPlugin(AbstractInputPlugin):

I believe the fix for this should be something along the lines of:

class InputPlugin(AbstractInputPlugin):
    __LEDGER: str = "Ledger"

    __TIMESTAMP_INDEX: int = 0
    __CURRENCY_INDEX: int = 2
    __OPERATION_TYPE_INDEX: int = 3
    __QUANTITY_INDEX: int = 4
    __FEE_INDEX: int = 5
    __TRANSACTION_ID_INDEX: int = 6

    __DELIMITER = ","

    __CURRENCY_ALIAS_DICT = {
        "FANTOM": "FTM",
    }
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant