fix(client): add network_region to async get_market + signature-parity test#35
Merged
Merged
Conversation
…y test OEClient.get_market accepts network_region and threads it through to _async_get_market, but AsyncOEClient.get_market never did, so async users could not apply the same region filter sync users can. Same shape of bug as the unit_code parity gap PR #27 fixed for get_facility_data. Also adds tests/test_sync_async_parity.py — a parameterised inspect.signature check across the shared public surface (__init__, get_facilities, get_network_data, get_facility_data, get_market, get_current_user) so future sync/async kwargs cannot drift again without CI catching it.
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.
Surfaced by the v0.11.1 e2e review (R-002).
`OEClient.get_market` accepts `network_region` and forwards it to `_async_get_market`, but `AsyncOEClient.get_market` never did - async users couldn't apply the same region filter sync users can. Same shape as the `unit_code` parity bug PR #27 fixed for `get_facility_data`.
Fix
Add `network_region: str | None = None` to `AsyncOEClient.get_market` and include it in the debug log + params dict.
Plus signature-parity test
`tests/test_sync_async_parity.py` runs `inspect.signature` across the shared public surface (`init`, `get_facilities`, `get_network_data`, `get_facility_data`, `get_market`, `get_current_user`) and asserts sync == async. Would have caught both this bug and the original #27 issue. 6 tests, all pass.
Verified locally