openclimatefix / pv-site-production

Production service for PV site level forecasts
MIT License
1 stars 3 forks source link

PV data source crashes when there is no data #38

Closed simlmx closed 1 year ago

simlmx commented 1 year ago
df = df.set_index(["id", "ts"])
--
  | 2023-02-23T09:31:12.742-05:00 | File "/root/.cache/pypoetry/virtualenvs/pv-site-production-9TtSrW0h-py3.10/lib/python3.10/site-packages/pandas/util/_decorators.py", line 331, in wrapper
  | 2023-02-23T09:31:12.742-05:00 | return func(*args, **kwargs)
  | 2023-02-23T09:31:12.742-05:00 | File "/root/.cache/pypoetry/virtualenvs/pv-site-production-9TtSrW0h-py3.10/lib/python3.10/site-packages/pandas/core/frame.py", line 6012, in set_index
  | 2023-02-23T09:31:12.743-05:00 | raise KeyError(f"None of {missing} are in the columns")
  | 2023-02-23T09:31:12.743-05:00 | KeyError: "None of ['id', 'ts'] are in the columns"

Acceptance critera

  1. Reproduce
  2. Fix
simlmx commented 1 year ago

This was recently fixed: the latest models still works even when there is no historical data.