mincong-h / finance-toolkit

Finance Toolkit
3 stars 1 forks source link

ValueError: NaTType does not support strftime #88

Closed mincong-h closed 2 years ago

mincong-h commented 2 years ago
DEBUG:root:account-statement_(\d{4}-\d{2}-\d{2})_(\d{4}-\d{2}-\d{2})_undefined-undefined_(\w+)\.csv: matched
Traceback (most recent call last):
  File "/usr/local/bin/finance-toolkit", line 33, in <module>
    sys.exit(load_entry_point('finance-toolkit==0.1.0', 'console_scripts', 'finance-toolkit')())
  File "/usr/local/lib/python3.7/site-packages/finance_toolkit-0.1.0-py3.7.egg/finance_toolkit/__main__.py", line 71, in main
  File "/usr/local/lib/python3.7/site-packages/finance_toolkit-0.1.0-py3.7.egg/finance_toolkit/tx.py", line 240, in move
  File "/usr/local/lib/python3.7/site-packages/finance_toolkit-0.1.0-py3.7.egg/finance_toolkit/pipeline.py", line 35, in run
  File "/usr/local/lib/python3.7/site-packages/pandas-1.2.0-py3.7-linux-x86_64.egg/pandas/core/series.py", line 4108, in apply
    mapped = lib.map_infer(values, f, convert=convert_dtype)
  File "pandas/_libs/lib.pyx", line 2467, in pandas._libs.lib.map_infer
  File "/usr/local/lib/python3.7/site-packages/finance_toolkit-0.1.0-py3.7.egg/finance_toolkit/pipeline.py", line 35, in <lambda>
  File "pandas/_libs/tslibs/nattype.pyx", line 69, in pandas._libs.tslibs.nattype._make_error_func.f
ValueError: NaTType does not support strftime
mincong-h commented 2 years ago

After discussion with @jingwen-z , we realized that this is because we are using the column "Completed Date" as the date reference in the transactions for Revolut. However, some transactions' status can be "PENDING", which does not have a completed date. Since pending transactions represent a small portion of the data and only present in a short period and it's not interesting for reporting, we decide to ignore them.