csvs-to-sqlite icon indicating copy to clipboard operation
csvs-to-sqlite copied to clipboard

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

Open hcarter333 opened this issue 1 year ago • 0 comments

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

hcarter333 avatar Sep 25 '23 03:09 hcarter333