Jan W
05/24/2023, 8:01 PMCREATE TABLE Warsaw_weather (temp float, clouds int, wind float, humidity int, pressure int, weather_id int, sunrise timestamp, sunset timestamp, timestamp timestamp)
next I am trying to write some data like so:
with Sender('localhost', 9009) as sender:
sender.row(
(city+"_weather"),
columns = {
'temp' : float(row[0]),
'clouds' : int(row[1]),
'wind' : float(row[2]),
'humidity' : int(row[3]),
'pressure' : int(row[4]),
'weather_id' : int(row[5]),
'sunrise' : pd.to_datetime(row[6]).timestamp(),
'sunset' : pd.to_datetime(row[7]).timestamp(),
'timestamp': datetime.datetime.now().timestamp() * 1000000 # Current timestamp in nanoseconds
},
# at=time_waw
)
sender.flush()
I am sure that the code attempts to write to the correct table however no data is added. also there are no errors and the code runs as expected. When I run the code without creating the table before a table is automatically created but it has floats instead of ints.
I would appreciate any help with this issue. Thanks!Jaromir Hamala
05/24/2023, 8:16 PMJan W
05/24/2023, 8:18 PMexcept Exception as e:
print(f'error, retrying in {INTERVAL}s\n {e}')
'sunrise' : <http://pd.to|pd.to>_datetime(row[6] * 1000000000),
Andrey Pechkurov
05/25/2023, 6:47 AMi
suffix) or with t
suffix. The granularity is microseconds.
https://questdb.io/docs/reference/api/ilp/columnset-types/#timestamp