Skip to content

Commit fc58cc2

Browse files
committed
only append if there are results
1 parent 65785f9 commit fc58cc2

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/quartz_api/internal/service/uk_national/gsp_router.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,12 @@ async def get_truths_for_all_gsps(
612612
observer_name=f"pvlive_{regime}",
613613
authdata={},
614614
)
615-
out.append(GSPYieldGroupByDatetime(
616-
datetime_utc=ts,
617-
generation_kw_by_gsp_id={
618-
gsp_uuid_id_map[v.location_uuid]: v.power_kilowatts for v in tsout
619-
}),
615+
if len(tsout) > 0:
616+
out.append(GSPYieldGroupByDatetime(
617+
datetime_utc=ts,
618+
generation_kw_by_gsp_id={
619+
gsp_uuid_id_map[v.location_uuid]: v.power_kilowatts for v in tsout
620+
}),
620621
)
621622

622623
return out

0 commit comments

Comments
 (0)