diff --git a/internal/server/postgres/dataserverimpl.go b/internal/server/postgres/dataserverimpl.go index 7a0709e..d9cf6d3 100644 --- a/internal/server/postgres/dataserverimpl.go +++ b/internal/server/postgres/dataserverimpl.go @@ -1051,11 +1051,11 @@ func (s *DataPlatformDataServiceServerImpl) GetObservationsAtTimestamp( // Check that the observer exists obprms := db.GetObserverByNameParams{ObserverName: req.ObserverName} - + dbObserver, err := querier.GetObserverByName(ctx, obprms) if err != nil { l.Err(err).Msgf("querier.GetObserverByName(%+v)", obprms) - + return nil, status.Errorf( codes.NotFound, "No observer of name '%s' found. Choose an existing observer or create a new one.", diff --git a/internal/server/postgres/dataserverimpl_test.go b/internal/server/postgres/dataserverimpl_test.go index 905e804..a57aceb 100644 --- a/internal/server/postgres/dataserverimpl_test.go +++ b/internal/server/postgres/dataserverimpl_test.go @@ -679,7 +679,6 @@ func TestGetObservationsAtTimestamp(t *testing.T) { if strings.Contains(tc.name, "Shouldn't") { require.Error(t, err) } else { - require.NoError(t, err) require.NotNil(t, resp) require.Len(t, resp.Values, len(tc.expectedFractions)) diff --git a/internal/server/postgres/sql/queries/predictions.sql b/internal/server/postgres/sql/queries/predictions.sql index 53815a0..464f104 100644 --- a/internal/server/postgres/sql/queries/predictions.sql +++ b/internal/server/postgres/sql/queries/predictions.sql @@ -224,7 +224,7 @@ WHERE f.forecast_uuid = $1 * Predicted values are smallint percentages (sip) of capcity; * with 0 representing 0% and 30000 representing 100% of capacity. * - * Note that the 2 day intervals are due to our forecasts only going out to 2 days. + * Note that the 3 day intervals are due to our forecasts only going out to 2 days. * If we increase that horizon, these will need to be increased. */ WITH relevant_forecasts AS ( @@ -244,7 +244,7 @@ WITH relevant_forecasts AS ( COALESCE( sqlc.narg(pivot_timestamp)::TIMESTAMP, sqlc.arg(start_timestamp_utc)::TIMESTAMP - ) - INTERVAL '2 days' + ) - INTERVAL '3 days' ) AND f.forecast_uuid < UUIDV7_BOUNDARY( COALESCE( @@ -307,7 +307,7 @@ ORDER BY * This is useful for comparing predictions across multiple locations. * Predicted values are 16-bit integers, with 0 representing 0% and 30000 representing 100% of capacity. * - * Note that the 2 day intervals are due to our forecasts only going out to 2 days. + * Note that the 3 day intervals are due to our forecasts only going out to 2 days. * If we increase that horizon, these will need to be increased. */ WITH relevant_forecasts AS ( @@ -327,7 +327,7 @@ WITH relevant_forecasts AS ( COALESCE( sqlc.narg(pivot_timestamp)::TIMESTAMP, sqlc.arg(target_timestamp_utc)::TIMESTAMP - ) - INTERVAL '2 days' + ) - INTERVAL '3 days' ) AND f.forecast_uuid < UUIDV7_BOUNDARY( COALESCE(