fix: export FeedClient from Python SDK#835
Conversation
realfishsam
left a comment
There was a problem hiding this comment.
PR Review: VERIFIED
What This Does
Exports FeedClient from the Python SDK's top-level pmxt package so consumers can write from pmxt import FeedClient (or pmxt.FeedClient) without digging into the internal pmxt.feed_client submodule. The companion commit refreshes auto-generated API reference docs to document fetchSeries, UnifiedSeries, and sourceMetadata.
Blast Radius
- Python SDK only (
sdks/python/pmxt/__init__.py,sdks/python/tests/test_public_exports.py): two lines of hand-written code - Auto-generated docs updated:
sdks/python/API_REFERENCE.md,sdks/typescript/API_REFERENCE.md,core/api-doc-config.generated.json - No changes to
core/, no exchange logic, no types, no OpenAPI schema, no server, no auth, no router
Consumer Verification
Before (main branch):
from pmxt import FeedClient
# ImportError: cannot import name 'FeedClient' from 'pmxt'
import pmxt; pmxt.FeedClient
# AttributeError: module 'pmxt' has no attribute 'FeedClient'Verified by AST inspection of sdks/python/pmxt/__init__.py on main: FeedClient absent from both imports and __all__.
After (PR branch):
from pmxt import FeedClient # works
import pmxt; feed = pmxt.FeedClient('chainlink') # worksFeedClient is imported from feed_client module and listed in __all__. Both verified via AST inspection on PR branch.
Sidecar health and Polymarket fetchMarkets smoke test confirmed working (success: True, 64742 markets returned) — this PR doesn't touch the sidecar at all.
Test Results
- Build (core TypeScript): PASS
- Core unit tests: PASS — 631/631 (22 test suites)
- Python
test_public_exports.py: PASS — 4/4 (including newtest_feed_client_is_top_level_public_export) - Full Python suite: NOT RUN —
pmxt_internalgenerated module not present in repo (build-time artifact); not attributable to this PR - TypeScript SDK build: NOT RUN — same reason (
generated/src/index.jsnot present) - E2E smoke (Polymarket): PASS — sidecar returns markets correctly
Findings
- TypeScript SDK has the same omission (non-blocking, separate issue) —
sdks/typescript/pmxt/feed-client.tsexists and is fully implemented, butFeedClientis not exported fromsdks/typescript/index.ts.import { FeedClient } from 'pmxtjs'will fail at runtime. The PR title is explicitly scoped to Python, so this is intentional deferral — but worth tracking. api-doc-config.generated.jsontestDummyMethod→close— the generated docs previously exposed an internaltestDummyMethodas a public API entry. The new regeneration correctly showsclose()in its place. This is a docs-only fix, not a behavior change.
No blocking findings.
PMXT Pipeline Check
- Field propagation (3-layer): N/A — no type changes
- OpenAPI sync: N/A — no
BaseExchangeor schema changes - Financial precision: N/A
- Type safety: OK —
FeedClientis a concrete class, noanyintroduced - Auth safety: N/A — no credentials touched
Semver Impact
patch — adds a previously missing public export; no existing behavior changed, no API removed
Risk
- TypeScript SDK parity:
FeedClientstill not exported frompmxtjs. Consumers on the TS side face the same import problem; needs a follow-up PR. - Full Python integration test suite and TypeScript SDK build could not be run locally (both require generated artifacts not tracked in git). CI is the only gate for those paths.
Mirrors the Python export fix in this PR. Adds FeedClient to the
top-level pmxtjs exports and the default pmxt object so consumers can
write `import { FeedClient } from 'pmxtjs'` or `pmxt.FeedClient(...)`.
Co-authored-by: nanookclaw <nanookclaw@users.noreply.github.com>
Summary
Closes #830.
The Python SDK already includes
sdks/python/pmxt/feed_client.py, but the package initializer did not exposeFeedClientat the top level. This adds the missing import and includesFeedClientinpmxt.__all__, so callers can usefrom pmxt import FeedClientlike the issue requests.I also extended the existing public-export regression test to assert that
FeedClientstays imported fromfeed_clientand listed in__all__.Verification
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest sdks/python/tests/test_public_exports.pygit diff --check