-
Notifications
You must be signed in to change notification settings - Fork 248
Description
When calling: client.query_generation(tag, start=start, end=end)
we are intermittently receiving the following error: ValueError: All objects passed were None
Cause:
I traced this back to the time series parsing logic and found the following:
The API response returns HTTP 200 and contains multiple TimeSeries elements.
For the first TimeSeries, metadata fields such as mRID, curveType, etc. are present, but the Period element (and therefore the associated values) is missing.
When the client attempts to parse this response in _parse_timeseries_generic, it processes the first TimeSeries and extracts no values, resulting in an empty series dictionary.
In series_parsers.py at line 127, if merge_series is True (which is the common case), the code executes: pd.concat(series.values())
Because series is effectively empty (or contains only None-like entries), this raises: ValueError: All objects passed were None .
Once this exception is raised, the client stops processing and never reaches the subsequent TimeSeries elements in the response, even though they may contain valid data.
Proposed fix:
Modify the parsing logic so that TimeSeries elements without a Period (and thus without values) are skipped. In other words, if the parsed soup for a TimeSeries does not contain a period tag (or equivalent structure with values), it should be ignored rather than included in the series to be concatenated.
This would prevent the All objects passed were None error and allow the client to continue processing the remaining TimeSeries entries that do contain data.
