Skip to content

fix(types): remove DataMetric.RENEWABLE_PROPORTION (use MarketMetric)#33

Merged
nc9 merged 1 commit into
mainfrom
fix/remove-data-renewable-proportion
May 25, 2026
Merged

fix(types): remove DataMetric.RENEWABLE_PROPORTION (use MarketMetric)#33
nc9 merged 1 commit into
mainfrom
fix/remove-data-renewable-proportion

Conversation

@nc9

@nc9 nc9 commented May 25, 2026

Copy link
Copy Markdown
Member

Closes #18

Diagnosis

renewable_proportion is a market-level metric. The API exposes it on /market/network/ via MarketMetric.RENEWABLE_PROPORTION (shipped in v0.11.0). It is not exposed on /data/network/.

But the SDK also had it as DataMetric.RENEWABLE_PROPORTION, so users following the obvious pattern hit a confusing API error:

# what users tried (issue #18)
c.get_network_data(metrics=[DataMetric.RENEWABLE_PROPORTION], ...)
# -> 400 Bad Request, no useful message

Verified live against prod:

  • DataMetric.RENEWABLE_PROPORTION via get_network_data -> 400 Bad Request
  • MarketMetric.RENEWABLE_PROPORTION via get_market -> OK (48 hourly points, NEM ~32%)

Fix

Drop the broken enum value from DataMetric so users can't reach the dead path. The DataMetric docstring now points to the working MarketMetric one.

Backwards compat

Technically removes an enum value, but the value never produced anything but a 400 on prod (it was the dev-only metric @nc9 flagged in #18). No real code can have been relying on it.

The renewable proportion is a market-level metric. The API only exposes
it via /market/network/ (MarketMetric.RENEWABLE_PROPORTION, shipped in
v0.11.0). It is not implemented on /data/network/, so calling
get_network_data(metrics=[DataMetric.RENEWABLE_PROPORTION]) returned a
confusing 400 with no useful message.

Drop the dead enum value so users can't accidentally use the broken
path; document the correct one in the DataMetric docstring.

Fixes #18
@nc9 nc9 merged commit ba3839e into main May 25, 2026
5 checks passed
@nc9 nc9 deleted the fix/remove-data-renewable-proportion branch May 25, 2026 22:57
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.

Can't get DataMetric.RENEWABLE_PROPORTION to work

1 participant