mincong-h / finance-toolkit

Finance Toolkit
3 stars 1 forks source link

ValueError: NaTType does not support strftime #101

Open mincong-h opened 4 months ago

mincong-h commented 4 months ago
Traceback (most recent call last):
  File "/usr/local/bin/finance-toolkit", line 33, in <module>
    sys.exit(load_entry_point('finance-toolkit==1.4.0', 'console_scripts', 'finance-toolkit')())
  File "/usr/local/lib/python3.10/site-packages/finance_toolkit-1.4.0-py3.10.egg/finance_toolkit/__main__.py", line 76, in main
  File "/usr/local/lib/python3.10/site-packages/finance_toolkit-1.4.0-py3.10.egg/finance_toolkit/tx.py", line 247, in move
  File "/usr/local/lib/python3.10/site-packages/finance_toolkit-1.4.0-py3.10.egg/finance_toolkit/pipeline.py", line 45, in run
  File "/usr/local/lib/python3.10/site-packages/pandas-1.3.5-py3.10-linux-x86_64.egg/pandas/core/series.py", line 4357, in apply
    return SeriesApply(self, func, convert_dtype, args, kwargs).apply()
  File "/usr/local/lib/python3.10/site-packages/pandas-1.3.5-py3.10-linux-x86_64.egg/pandas/core/apply.py", line 1043, in apply
    return self.apply_standard()
  File "/usr/local/lib/python3.10/site-packages/pandas-1.3.5-py3.10-linux-x86_64.egg/pandas/core/apply.py", line 1098, in apply_standard
    mapped = lib.map_infer(
  File "pandas/_libs/lib.pyx", line 2859, in pandas._libs.lib.map_infer
  File "/usr/local/lib/python3.10/site-packages/finance_toolkit-1.4.0-py3.10.egg/finance_toolkit/pipeline.py", line 45, in <lambda>
  File "pandas/_libs/tslibs/nattype.pyx", line 75, in pandas._libs.tslibs.nattype._make_error_func.f
ValueError: NaTType does not support strftime
mincong-h commented 4 months ago

I think this is because there is a new row appeared in Revolut's account statement, which reverted the previous transaction, and the completed date is not defined (the column right after the started date)

CARD_PAYMENT,Current,2024-04-11 16:32:35,,Amazon Web Services,-1.00,0.00,EUR,REVERTED,
mincong-h commented 4 months ago

workaround: fill that date using the started date