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

When using -dt option all csv files must contain column identified as a datetime #94

Open
hcarter333 opened this issue Sep 25, 2023 · 0 comments

Comments

@hcarter333
Copy link

Using the following command:

csvs-to-sqlite -dt timestamp rm_rnb_history_pres.csv qsl_locs.csv  rm_toucans_qsl.
db

results in the error text

File "/usr/local/python/3.10.8/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3800, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'timestamp'

when the table qsl_locs.csv does not have also have a column named timestamp.

I worked around the issue by adding a column to qsl_locs.csv named timestamp, and populating it with valid datetime info.
The files passed to the command can be seen at
https://github.com/hcarter333/rm-rbn-history/blob/main/rm_rnb_history_pres.csv

and

https://github.com/hcarter333/rm-rbn-history/blob/main/qsl_locs.csv

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

No branches or pull requests

1 participant