Bugazelle/export-csv-to-influx

Cannot handle times before posix 1000000000

Closed this issue · 2 comments

7yl4r commented

When processing 9-digit posix timestamps an error is thrown and the times are not inserted into influxdb.
I haven't tested it but I expect all timestamps less than 10 digits long will also fail.

I think the code expects a 10-digit timestamp and appends zeros to the end of the timestamp in an attempt to convert seconds to nanoseconds.

timestamp_float = float(row[time_column])
timestamp_remove_decimal = int(str(timestamp_float).replace('.', ''))
timestamp_influx = '{:<019d}'.format(timestamp_remove_decimal)
timestamp = int(timestamp_influx)

Hello @7yl4r

Really apologies for the dealy.
Year 2020 is a HELL Mode for me for both life and work.

I will take on this soon these days.

Thank you

Hello @7yl4r :

Really appreciate for the pull requests.
You are right, it is a bug.

Thank you for the contribution!!
Now your code is in master branch now.

Have a nice day to you.

Cheers,
Bugazelle