csvs-to-sqlite
csvs-to-sqlite copied to clipboard
When using -dt option all csv files must contain column identified as a datetime
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