Skip to content

fix: remove dangerous defaults from Python create_order/build_order#598

Merged
realfishsam merged 1 commit into
mainfrom
fix/466-python-dangerous-defaults
May 24, 2026
Merged

fix: remove dangerous defaults from Python create_order/build_order#598
realfishsam merged 1 commit into
mainfrom
fix/466-python-dangerous-defaults

Conversation

@realfishsam
Copy link
Copy Markdown
Contributor

Fixes #466

@realfishsam
Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Removes dangerous default values from create_order and build_order in the Python SDK. Previously, side defaulted to "buy", type defaulted to "market", and amount defaulted to 0. These defaults were hazardous -- a user who forgot to specify side or type would silently execute a market buy order. Now all three parameters are keyword-only (enforced by the bare * separator) with no defaults, requiring explicit values.

Blast Radius

  • sdks/python/pmxt/client.py -- create_order() and build_order() signatures

Findings

  1. Breaking change: all three params (side, type, amount) are now required keyword-only. Existing code calling exchange.create_order(market_id, outcome_id, "buy", "limit", 10, 0.55) with positional args will break because the bare * forces everything after outcome_id to be keyword-only. This is intentional and correct for safety.
  2. Merge conflict with PR 600. PR 600 renames type to order_type in the same functions. If PR 598 merges first, PR 600 will need rebasing. If PR 600 merges first, this PR will need rebasing. Both PRs modify the same lines. The desired end state should combine both changes: keyword-only order_type (not type) with no defaults.

PMXT Pipeline Check

  • Field propagation: N/A
  • OpenAPI sync: N/A
  • Type safety: OK -- stronger parameter requirements

Semver Impact

major -- removes default values and adds keyword-only constraint; breaks callers relying on positional args or omitted parameters

Risk

Merge conflict with PR 600 is certain. Coordinate merge order. No tests are added in this PR to verify the new required-keyword behavior.

@realfishsam realfishsam force-pushed the fix/466-python-dangerous-defaults branch from d79e280 to 54e88fd Compare May 24, 2026 15:23
@realfishsam realfishsam merged commit 3c240ed into main May 24, 2026
8 of 11 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: Python create_order/build_order have dangerous defaults (side="buy", amount=0); TypeScript requires them

1 participant