fix(types): remove DataMetric.RENEWABLE_PROPORTION (use MarketMetric)#33
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #18
Diagnosis
renewable_proportionis a market-level metric. The API exposes it on/market/network/viaMarketMetric.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:Verified live against prod:
DataMetric.RENEWABLE_PROPORTIONviaget_network_data-> 400 Bad RequestMarketMetric.RENEWABLE_PROPORTIONviaget_market-> OK (48 hourly points, NEM ~32%)Fix
Drop the broken enum value from
DataMetricso users can't reach the dead path. TheDataMetricdocstring now points to the workingMarketMetricone.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.