Skip to content

Commit fada5b4

Browse files
committed
Remove internal empty-data check from retrieve_data()
The check for empty reporting data was removed from `retrieve_data()` because the calling application already handles this case and raises a `NoDataAvailableError`. Keeping this check caused the app to fail prematurely with a generic `ValueError`. This change ensures consistent error handling and allows the app to control the flow. Signed-off-by: cyiallou - Costas <[email protected]>
1 parent fbda366 commit fada5b4

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414

1515
## Bug Fixes
1616

17-
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
17+
- Removed internal empty-data check from `data_fetch.retrieve_data()`. The app now consistently handles missing reporting data by raising `NoDataAvailableError`.

src/frequenz/lib/notebooks/solar/maintenance/data_fetch.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ async def retrieve_data(
153153
ValueError:
154154
- If no service address or file path provided for weather or
155155
reporting data.
156-
- If no data is retrieved from the reporting API.
157156
- If the file path does not end with '.csv'.
158157
TypeError: If an unknown configuration type is provided.
159158
"""
@@ -193,8 +192,6 @@ async def retrieve_data(
193192
resampling_period=timedelta(seconds=config.resample_period_seconds),
194193
)
195194
]
196-
if not reporting_data:
197-
raise ValueError("No data retrieved from the reporting API.")
198195
return pd.DataFrame(reporting_data)
199196
if config.file_path:
200197
if config.verbose:

0 commit comments

Comments
 (0)