Skip to content

feat(hosted): send Parquet payloads by default, deprecate JSON - #470

Open
ggprior wants to merge 2 commits into
mainfrom
georg/parquet_default
Open

ggprior wants to merge 2 commits into
mainfrom
georg/parquet_default

Conversation

@ggprior

@ggprior ggprior commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

The self-hosted estimators (tabpfn_client.hosted) now default to payload_format="parquet". Passing payload_format="json" still works but emits a FutureWarning; JSON payloads will be removed in a future release.

Why Parquet: it is smaller and faster to encode, carries missing and non-finite values exactly (JSON needs the non-standard NaN / Infinity literals), and lets an endpoint check a table's size from its metadata before decoding it, so large tables are admitted by their real size.

Decisions:

  • No sentinel default. Only an explicit "json" can produce JSON now, so the plain value is enough, and get_params() / clone() see the argument unchanged.
  • The warning fires in predict*, beside the existing tabpfn_systems check, not in __init__: sklearn estimators must not validate in the constructor. FutureWarning, not DeprecationWarning, which Python hides unless raised from __main__, so calls from inside Pipeline or cross_validate would never show it; stacklevel points at the caller's predict* line.
  • Breaking for endpoints that accept only JSON bodies; they need payload_format="json" until removal. Changelog: 470.breaking.md, 470.deprecated.md.
  • The client owns Content-Type on both paths, like the routing headers: a Content-Type in extra_headers (any casing) is dropped, so httpx's multipart header keeps its boundary, and the JSON path always sends application/json. Changelog: 470.changed.md.

Tests: the shared test helpers decode either wire format, so the existing request-shape tests now run on the Parquet default. New tests cover the default, no warning on "parquet", the warning on explicit "json" (none at construction or fit), get_params()/clone() for both values, and a user Content-Type being ignored on both paths (Parquet boundary intact and the body still parses).

🤖 Generated with Claude Code

Parquet is smaller and faster to encode, carries missing and non-finite
values exactly, and lets an endpoint check a table's size from its
metadata before decoding it, so large tables are admitted by their real
size. An explicit payload_format="json" keeps working but warns at
predict time; the constructor still stores the argument unchanged, so
get_params() and clone() behave as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011EUDq8MGfcUwDxBY5o7GhK
@ggprior
ggprior marked this pull request as ready for review November 25, 2026 11:33
@ggprior
ggprior requested a review from a team as a code owner November 25, 2026 11:33

@eddiebergman-priorlabs eddiebergman-priorlabs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No chance of this in the main client? Love it

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 using high effort 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 856bbf3. Configure here.

import json
import time
import uuid
import warnings

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parquet predict drops fit column names

High Severity

Making Parquet the default now sends feature names on every hosted predict*. _to_parquet_part wraps a numpy X as a DataFrame with integer columns instead of reusing names from X_train_. After a DataFrame fit, an ndarray predict (sklearn contract, and what SHAP/PDP pass) ships train columns like a,b and test columns 0,1, which the endpoint rejects. JSON never sent names, so this path used to work.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by learned rule: Parquet payloads must reuse fit-time column names on predict

Reviewed by Cursor Bugbot for commit 856bbf3. Configure here.

DeprecationWarning is hidden by default unless raised from __main__, so
calls from inside Pipeline or cross_validate never showed it.

A Content-Type in extra_headers replaced the multipart one httpx writes,
dropping its boundary, so the endpoint could not parse the body. The
client now sets Content-Type from the payload format on both paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011EUDq8MGfcUwDxBY5o7GhK

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reapproving after a push, as this is a PR from an internal author and was already approved.

This branch has not been deployed

No deployments
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.

2 participants