Skip to content

fix(client): add network_region to async get_market + signature-parity test#35

Merged
nc9 merged 1 commit into
mainfrom
fix/async-get-market-network-region
May 26, 2026
Merged

fix(client): add network_region to async get_market + signature-parity test#35
nc9 merged 1 commit into
mainfrom
fix/async-get-market-network-region

Conversation

@nc9

@nc9 nc9 commented May 26, 2026

Copy link
Copy Markdown
Member

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

  • 6 parity tests pass after the fix.
  • Full offline suite: 28 passed, 0 failures (2 live API tests deselected without a key).
  • ruff lint + format clean.

…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.
@nc9 nc9 merged commit 93721ed into main May 26, 2026
5 checks passed
@nc9 nc9 deleted the fix/async-get-market-network-region branch May 26, 2026 00:16
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