From 051a6d7427e08a3dde115cc845115249d5019b0e Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Tue, 17 Mar 2026 16:13:00 -0500 Subject: [PATCH] Fixed a bug in the current conditions query (prior function not implemented by postgres) --- internal/adapters/postgres/queries.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/internal/adapters/postgres/queries.go b/internal/adapters/postgres/queries.go index 2e65669..0cc9a43 100644 --- a/internal/adapters/postgres/queries.go +++ b/internal/adapters/postgres/queries.go @@ -22,18 +22,7 @@ SELECT AVG(dewpoint_c) AS dewpoint_c, AVG(relative_humidity_percent) AS relative_humidity_percent, AVG(wind_speed_kmh) AS wind_speed_kmh, - CASE - WHEN COUNT(wind_direction_degrees) FILTER (WHERE wind_direction_degrees IS NOT NULL) = 0 THEN NULL - ELSE MOD( - DEGREES( - ATAN2( - AVG(SIN(RADIANS(wind_direction_degrees))), - AVG(COS(RADIANS(wind_direction_degrees))) - ) - ) + 360.0, - 360.0 - ) - END AS wind_direction_degrees, + AVG(wind_direction_degrees) AS wind_direction_degrees, MAX(condition_code) AS condition_code, ( SELECT is_day