Skip to content

feat(models): expose fueltech and renewable columns on TimeSeriesColumns#34

Merged
nc9 merged 1 commit into
mainfrom
feat/timeseries-columns-fueltech-renewable
May 26, 2026
Merged

feat(models): expose fueltech and renewable columns on TimeSeriesColumns#34
nc9 merged 1 commit into
mainfrom
feat/timeseries-columns-fueltech-renewable

Conversation

@nc9

@nc9 nc9 commented May 25, 2026

Copy link
Copy Markdown
Member

Surfaced while validating #8: calling `get_network_data(secondary_grouping='fueltech' | 'renewable')` returns the grouping in the result's `columns` object, but `TimeSeriesColumns` only declared `unit_code`, `fueltech_group` and `network_region` — so the actual grouping value was silently dropped on parse and users had to fish it out of `result.name` (`"energy_solar_rooftop"`).

Change

```python
class TimeSeriesColumns(BaseModel):
unit_code: str | None = None
fueltech: str | None = None # NEW
fueltech_group: str | None = None
renewable: bool | None = None # NEW
network_region: str | None = None
```

Verified

  • 2 new parse tests in `tests/models/test_timeseries.py`.
  • Live against prod and dev for both groupings — column now populates correctly (e.g. `fueltech='battery'`, `renewable=False`).

Out of scope

`secondary_grouping='status'` returns a 500 from the API (separate server-side bug). Worth a tracking issue in `opennem/opennem`.

When calling get_network_data with secondary_grouping='fueltech' or
secondary_grouping='renewable', the API returns the grouping value in
the result's columns object — but the SDK model only declared
unit_code/fueltech_group/network_region, dropping these on parse.

Add fueltech: str | None and renewable: bool | None so users can read
the grouping from columns directly instead of parsing it out of the
series name.
@nc9 nc9 merged commit 4205f32 into main May 26, 2026
5 checks passed
@nc9 nc9 deleted the feat/timeseries-columns-fueltech-renewable branch May 26, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant