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

parsing report error #4

Open
gerilya opened this issue May 7, 2024 · 0 comments · May be fixed by #5
Open

parsing report error #4

gerilya opened this issue May 7, 2024 · 0 comments · May be fixed by #5

Comments

@gerilya
Copy link

gerilya commented May 7, 2024

The report was created according to Fintranslator's instructions available here.

Here is the error:

Enter the IBKR statement CSV path (default: 2023_ibkr_report.csv): test.csv
Enter the rate CSV file path (will try to find it at: usd_ils.csv or otherwise fetch it from BOI):
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniconda/base/envs/tfs-workshop-test1/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/homebrew/Caskroom/miniconda/base/envs/tfs-workshop-test1/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/USER/work/TEMP/IBKR-to-1325-form/src/__main__.py", line 115, in <module>
    main()
  File "/Users/USER/work/TEMP/IBKR-to-1325-form/src/__main__.py", line 35, in main
    result_df = statement_to_1325_form(schema_name_to_df['Trades'], rate_csv_path)
  File "/Users/USER/work/TEMP/IBKR-to-1325-form/src/statement_to_1325.py", line 13, in statement_to_1325_form
    df_statement["Date"] = pd.to_datetime(df_statement["Date/Time"]).dt.date
  File "/opt/homebrew/Caskroom/miniconda/base/envs/tfs-workshop-test1/lib/python3.9/site-packages/pandas/core/tools/datetimes.py", line 1112, in to_datetime
    values = convert_listlike(arg._values, format)
  File "/opt/homebrew/Caskroom/miniconda/base/envs/tfs-workshop-test1/lib/python3.9/site-packages/pandas/core/tools/datetimes.py", line 488, in _convert_listlike_datetimes
    return _array_strptime_with_fallback(arg, name, utc, format, exact, errors)
  File "/opt/homebrew/Caskroom/miniconda/base/envs/tfs-workshop-test1/lib/python3.9/site-packages/pandas/core/tools/datetimes.py", line 519, in _array_strptime_with_fallback
    result, timezones = array_strptime(arg, fmt, exact=exact, errors=errors, utc=utc)
  File "strptime.pyx", line 534, in pandas._libs.tslibs.strptime.array_strptime
  File "strptime.pyx", line 355, in pandas._libs.tslibs.strptime.array_strptime
ValueError: time data "2022-08-18" doesn't match format "%Y-%m-%d %H:%M:%S", at position 1. You might want to try:
    - passing `format` if your strings have a consistent format;
    - passing `format='ISO8601'` if your strings are all ISO8601 but not necessarily in exactly the same format;
    - passing `format='mixed'`, and the format will be inferred for each element individually. You might want to use `dayfirst` alongside this.
@gerilya gerilya linked a pull request May 8, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant