Skip to content

feat(frames): add dataframe conversion foundation#69

Open
suhailkakar wants to merge 3 commits into
mainfrom
feat/dataframes-phase-1
Open

feat(frames): add dataframe conversion foundation#69
suhailkakar wants to merge 3 commits into
mainfrom
feat/dataframes-phase-1

Conversation

@suhailkakar
Copy link
Copy Markdown
Member

@suhailkakar suhailkakar commented Jun 4, 2026

Note

Medium Risk
New public API surface and pagination drain behavior can surprise callers who pass paginators without limit; type inference and decimal handling affect downstream analytics correctness, though behavior is heavily tested.

Overview
Adds a new polymarket.frames layer that turns Pydantic models, Page results, and homogeneous model sequences into PyArrow, pandas, or polars tables, with optional extras (arrow, pandas, polars, quant) and MissingOptionalDependencyError when backends are missing.

The Arrow path infers column types (including nested structs/lists, decimal precision/scale, and guarded numeric promotion) and supports a per-type override registry; OrderBook is flattened to per-level rows (with market/token_id when converting multiple books). Page, Paginator, AsyncPaginator, and OrderBook gain to_arrow / to_pandas / to_polars via a lazy _frames_bridge; paginator conversion requires limit (rejecting raw paginators on the free functions) and can set df.attrs["polymarket_truncated"] when capped.

Packaging updates optional dependencies, dev test deps, pyright relaxations under src/polymarket/frames, and a broad unit test suite for conversion, overrides, order books, pagination, and missing deps.

Reviewed by Cursor Bugbot for commit 8ae911c. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread src/polymarket/frames/_arrow.py
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a4a9601. Configure here.

Comment thread src/polymarket/pagination.py
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