Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/server/postgres/dataserverimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
1 change: 0 additions & 1 deletion internal/server/postgres/dataserverimpl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
8 changes: 4 additions & 4 deletions internal/server/postgres/sql/queries/predictions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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(
Expand Down Expand Up @@ -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 (
Expand All @@ -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(
Expand Down
Loading