Skip to content

fix: export FeedClient from Python SDK#835

Merged
realfishsam merged 3 commits into
pmxt-dev:mainfrom
nanookclaw:fix/export-feed-client
Jun 2, 2026
Merged

fix: export FeedClient from Python SDK#835
realfishsam merged 3 commits into
pmxt-dev:mainfrom
nanookclaw:fix/export-feed-client

Conversation

@nanookclaw
Copy link
Copy Markdown
Contributor

Summary

Closes #830.

The Python SDK already includes sdks/python/pmxt/feed_client.py, but the package initializer did not expose FeedClient at the top level. This adds the missing import and includes FeedClient in pmxt.__all__, so callers can use from pmxt import FeedClient like the issue requests.

I also extended the existing public-export regression test to assert that FeedClient stays imported from feed_client and listed in __all__.

Verification

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest sdks/python/tests/test_public_exports.py
  • git diff --check

Copy link
Copy Markdown
Contributor

@realfishsam realfishsam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')  # works

FeedClient 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 new test_feed_client_is_top_level_public_export)
  • Full Python suite: NOT RUNpmxt_internal generated module not present in repo (build-time artifact); not attributable to this PR
  • TypeScript SDK build: NOT RUN — same reason (generated/src/index.js not present)
  • E2E smoke (Polymarket): PASS — sidecar returns markets correctly

Findings

  1. TypeScript SDK has the same omission (non-blocking, separate issue)sdks/typescript/pmxt/feed-client.ts exists and is fully implemented, but FeedClient is not exported from sdks/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.
  2. api-doc-config.generated.json testDummyMethodclose — the generated docs previously exposed an internal testDummyMethod as a public API entry. The new regeneration correctly shows close() 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 BaseExchange or schema changes
  • Financial precision: N/A
  • Type safety: OKFeedClient is a concrete class, no any introduced
  • 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: FeedClient still not exported from pmxtjs. 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>
@realfishsam realfishsam merged commit 67d0fdc into pmxt-dev:main Jun 2, 2026
4 checks passed
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.

sdk-drift: FeedClient is not exported from Python package __init__.py

2 participants