Skip to content

feat(python): support message partitioning strategies - #3927

Open
jiengup wants to merge 1 commit into
apache:masterfrom
jiengup:python-partition-strategies
Open

feat(python): support message partitioning strategies#3927
jiengup wants to merge 1 commit into
apache:masterfrom
jiengup:python-partition-strategies

Conversation

@jiengup

@jiengup jiengup commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR address?

Closes #3896

Rationale

The Python SDK only supported sending messages to an explicit partition, while the Rust SDK also supports balanced and message-key partitioning.

What changed?

IggyClient.send_messages() now accepts a Python Partitioning object supporting fixed, balanced, and message-key routing. Existing integer partition IDs remain fully compatible, while string message keys are encoded as UTF-8 and validated against the 1–255 byte limit.

Type stubs, tests, and a runnable Python example covering all three strategies are included.

Local Execution

  • Passed all 87 tests in foreign/python/tests/test_message_operations.py
  • Passed Rust formatting and Clippy checks
  • Passed Ruff and Pyrefly checks for the Python SDK and examples
  • Successfully ran the partitioning example against a local Iggy server
  • Pre-commit hooks ran and passed

AI Usage

  1. Tool: OpenAI Codex
  2. Scope: Repository analysis, PyO3 implementation, tests, type stubs, documentation, and the Python example
  3. Verification: Reviewed the generated changes, ran the complete message operations test suite, static checks, pre-commit hooks, and the example against a local server
  4. Yes, I can explain every line of the changes

@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Aug 20, 2026
@jiengup jiengup changed the title Python SDK: support message partitioning strategies feat(python): support message partitioning strategies Aug 20, 2026
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.76%. Comparing base (3cd0860) to head (f715f3c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #3927   +/-   ##
=========================================
  Coverage     83.76%   83.76%           
  Complexity     1358     1358           
=========================================
  Files          1212     1213    +1     
  Lines        166189   166215   +26     
  Branches     133663   133663           
=========================================
+ Hits         139210   139236   +26     
  Misses        23342    23342           
  Partials       3637     3637           
Components Coverage Δ
Rust Core 84.55% <ø> (ø)
Java SDK 66.67% <ø> (ø)
C# SDK 76.08% <ø> (ø)
Python SDK 90.11% <100.00%> (+0.11%) ⬆️
PHP SDK 84.48% <ø> (ø)
Node SDK 95.84% <ø> (ø)
Go SDK 68.32% <ø> (ø)
Files with missing lines Coverage Δ
foreign/python/src/client.rs 99.85% <100.00%> (+<0.01%) ⬆️
foreign/python/src/lib.rs 100.00% <100.00%> (ø)
foreign/python/src/partitioning.rs 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python SDK: expose partitioning strategies for send_messages

1 participant