Skip to content

Commit

Permalink
MoreCast ML query bug (bcgov#3288)
Browse files Browse the repository at this point in the history
Fixes bug in MoreCast ML SQL query
  • Loading branch information
brettedw authored Dec 14, 2023
1 parent 242ed88 commit 4d95696
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/app/db/crud/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def get_actuals_left_outer_join_with_predictions(
ModelRunPrediction.station_code == station_code))\
.outerjoin(PredictionModelRunTimestamp,
and_(PredictionModelRunTimestamp.id ==
ModelRunPrediction.prediction_model_run_timestamp_id,
PredictionModelRunTimestamp.prediction_model_id == model_id))\
ModelRunPrediction.prediction_model_run_timestamp_id))\
.filter(HourlyActual.station_code == station_code)\
.filter(HourlyActual.weather_date >= start_date)\
.filter(HourlyActual.temp_valid == True)\
.filter(HourlyActual.rh_valid == True)\
.filter(HourlyActual.weather_date <= end_date)\
.filter(PredictionModelRunTimestamp.prediction_model_id == model_id)\
.order_by(HourlyActual.station_code)\
.order_by(HourlyActual.weather_date)\
.order_by(PredictionModelRunTimestamp.prediction_run_timestamp.desc())
Expand Down

0 comments on commit 4d95696

Please sign in to comment.