Bugazelle / export-csv-to-influx

The python library to write the CSV data into Influx. Support me via Bitcoin: bc1qqgkmph9cvygzxfpupv4jr4n0nfx3qumwg39j5w
BSD 3-Clause "New" or "Revised" License
35 stars 10 forks source link

TimeStamp Issues (postic/unix) 19 digits posix #43

Open ghost opened 3 years ago

ghost commented 3 years ago

Seems to be unable to import 19 digit posix dates

python3 csvtoinflux.py -i server1.csv -s server5:8086 --create --dbname NewTest --tagcolumns host --fieldcolumns CPU,GPU --metricname name --timecolumn time --timeformat posix _Deleting database NewTest Creating database NewTest Traceback (most recent call last): File "csvtoinflux.py", line 200, in args.timezone, args.ssl) File "csvtoinflux.py", line 78, in loadCsv datetime_naive = datetime.datetime.fromtimestamp(int(row[timecolumn])) OverflowError: timestamp out of range for platform timet

CSV looks like this :

name,time,CPU,GPU,host temperature,1590335330162702714,53.5,53,server1 temperature,1590335335297033388,54,53,server1

7yl4r commented 3 years ago

The relevant code is here. It would be great to have a test for this.

Bugazelle commented 2 years ago

Hello @lee-weedon

Sorry for the delay The latest lib 0.2.0 should fix your issue

Please upgrade to the latest version: pip install ExportCsvToInflux --upgrade