Skip to content

fix(python): guard nullable market slug cache#951

Open
realfishsam wants to merge 1 commit into
mainfrom
fix/easy-156-load-markets-slug
Open

fix(python): guard nullable market slug cache#951
realfishsam wants to merge 1 commit into
mainfrom
fix/easy-156-load-markets-slug

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Summary

  • Skip slug index entries when a loaded market has no slug
  • Mirrors the TypeScript loadMarkets guard and prevents crashes on slugless venues

Fixes #156

Test Plan

  • git diff --check
  • python3 -m py_compile sdks/python/pmxt/client.py

@realfishsam

Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Guards the Python SDK market slug cache so markets with slug=None are still cached by market id but no longer create a None key in markets_by_slug.

Blast Radius

Python SDK only: Exchange.load_markets() cache population. No core/server/OpenAPI changes.

Consumer Verification

Before (base branch):
On base, a UnifiedMarket with slug=None would execute self.markets_by_slug[market.slug] = market, creating a None lookup entry. I did not run a Python consumer repro because this runner is missing pytest for the SDK test phase.

After (PR branch):
Patch adds if market.slug: before writing the slug cache. Core build passed and core Jest tests passed; full root verification stopped in the Python SDK phase with /usr/bin/python3: No module named pytest.

Test Results

  • Build: PASS
  • Unit tests: CORE PASS (24 suites, 644 tests; root verification then blocked by missing pytest)
  • Server starts: PASS during root verification
  • E2E smoke: NOT VERIFIED (Python SDK environment missing pytest)

Findings

No blocking findings.

PMXT Pipeline Check

  • Field propagation (3-layer): N/A
  • OpenAPI sync: N/A
  • Financial precision: N/A
  • Type safety: OK
  • Auth safety: N/A

Semver Impact

patch -- Python SDK cache bug fix without API shape change.

Risk

Python SDK runtime behavior was inspected from the diff but not executed end-to-end in this environment because pytest is not installed.

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.

Python load_markets: no None-guard on market.slug causes KeyError/TypeError

1 participant