From 905fa90c9b6d8392d77193e6770d6573b4080628 Mon Sep 17 00:00:00 2001 From: Manuel Carrer Date: Tue, 11 Jun 2024 16:44:51 +0200 Subject: [PATCH] Add comments --- api/src/timeseries.rs | 2 ++ ingestion/src/kldata.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/api/src/timeseries.rs b/api/src/timeseries.rs index a5c84c6a..5be5cf16 100644 --- a/api/src/timeseries.rs +++ b/api/src/timeseries.rs @@ -127,6 +127,8 @@ pub async fn get_timeseries_data_regular( "P1D" => "1 day", _ => "1 minute", // FIXME: this should error instead of falling back to a default }; + + // TODO: this generates nulls till utc.now if end_time is not specified in the database? let query_string = format!("SELECT data.obsvalue, ts_rule.timestamp \ FROM (SELECT data.obsvalue, data.obstime FROM data WHERE data.timeseries = $1) as data RIGHT JOIN generate_series($2::timestamptz, $3::timestamptz, interval '{}') AS ts_rule(timestamp) \ diff --git a/ingestion/src/kldata.rs b/ingestion/src/kldata.rs index 522bd3e2..9d482a97 100644 --- a/ingestion/src/kldata.rs +++ b/ingestion/src/kldata.rs @@ -242,6 +242,8 @@ pub async fn filter_and_label_kldata( Some(row) => row.get(0), None => { // create new timeseries + // TODO: we insert a new timeseries with NULL location? + // Should we query for the station info? let timeseries_id = transaction .query_one( "INSERT INTO public.timeseries (fromtime) VALUES ($1) RETURNING id",