Skip to content

feat(python): add stream listing, update, delete, and purge - #3701

Open
felixfaisal wants to merge 6 commits into
apache:masterfrom
felixfaisal:feat/add-python-stream-management-functions
Open

feat(python): add stream listing, update, delete, and purge#3701
felixfaisal wants to merge 6 commits into
apache:masterfrom
felixfaisal:feat/add-python-stream-management-functions

Conversation

@felixfaisal

Copy link
Copy Markdown
Contributor

Which issue does this PR address?

Closes #3520

Rationale

The Python SDK exposed only create_stream and get_stream, so Python users
could not list, rename, delete, or purge streams — operations the Rust SDK
already supports. This closes that parity gap.

What changed?

Added get_streams, update_stream, delete_stream, and purge_stream to the
Python client by wrapping the Rust StreamClient methods via PyO3, plus a new
Stream wrapper class for the list result. Extended test_stream.py with
end-to-end coverage and regenerated apache_iggy.pyi.

Local Execution

  • Passed
  • Pre-commit hooks ran

AI Usage

If AI tools were used, please answer:

  1. Which tools? (e.g., GitHub Copilot, Claude, ChatGPT)
  • Claude Opus (4.8, 1M context)
  1. Scope of usage? (e.g., autocomplete, generated functions, entire implementation)
  • used a skill /teach to understand the bridge between Rust and Python and how the python SDK itself works with iggy, and the changes need to resolve this issue.
  • Once done, reviewed edits to each file manually
  1. How did you verify the generated code works correctly?
  • Reviewed the lines written
  • Created the python stub using this command:
cargo run --bin stub_gen 
  • and then fixed formatting using the below commands:
uv run ruff check --fix apache_iggy.pyi
uv run ruff format apache_iggy.pyi
  • the resulting file looked as expected
  • Ran the iggy server and then the python tests after it, using the commands written below:
  • In one terminal:
cargo run --bin iggy-server -- --with-default-root-credentials --fresh
  • and in another
uv run --no-sync pytest tests/test_stream.py -v
  • all the tests pass
  1. Can you explain every line of the code if asked?
    Yup

@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 Jul 18, 2026
@felixfaisal

Copy link
Copy Markdown
Contributor Author

/request-review @slbotbm

@felixfaisal

Copy link
Copy Markdown
Contributor Author

/request-review @hubcio

@github-actions
github-actions Bot requested review from hubcio and slbotbm July 18, 2026 23:47
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.73418% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.02%. Comparing base (b452d15) to head (ff4f7a6).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
foreign/python/src/stream.rs 95.45% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3701      +/-   ##
============================================
+ Coverage     76.01%   76.02%   +0.01%     
  Complexity      969      969              
============================================
  Files          1325     1325              
  Lines        162380   162459      +79     
  Branches     135260   135260              
============================================
+ Hits         123427   123508      +81     
+ Misses        35291    35289       -2     
  Partials       3662     3662              
Components Coverage Δ
Rust Core 75.94% <ø> (ø)
Java SDK 62.71% <ø> (ø)
C# SDK 72.26% <ø> (ø)
Python SDK 90.00% <98.73%> (+0.54%) ⬆️
PHP SDK 84.52% <ø> (ø)
Node SDK 96.15% <ø> (ø)
Go SDK 43.08% <ø> (ø)
Files with missing lines Coverage Δ
foreign/python/src/client.rs 99.27% <100.00%> (+0.06%) ⬆️
foreign/python/src/lib.rs 100.00% <100.00%> (ø)
foreign/python/src/stream.rs 95.00% <95.45%> (+17.22%) ⬆️
🚀 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.

@ryankert01 ryankert01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall lg to me, a comment.

Comment thread foreign/python/tests/test_stream.py Outdated
Comment on lines +229 to +230
mine = [by_name[name] for name in created]
assert [stream.id for stream in mine] == sorted(stream.id for stream in mine)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It occurs to me that it's not testing get_streams() ordering since it's constructed based on created ordering. Although I'm also not quite sure whether if iggy wants to ensure the ordering or not in the distributed future, kafka for example, don't.

Comment thread foreign/python/src/stream.rs
Comment thread foreign/python/src/client.rs Outdated
Comment thread foreign/python/src/client.rs Outdated
Comment thread foreign/python/src/client.rs Outdated
Comment thread foreign/python/src/client.rs Outdated
Comment thread foreign/python/src/stream.rs
Comment thread foreign/python/tests/test_stream.py Outdated
Comment thread foreign/python/tests/test_stream.py Outdated
Comment thread foreign/python/tests/test_stream.py
Comment thread foreign/python/tests/test_stream.py
@slbotbm

slbotbm commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Please do not force push. Instead, create new commits with your work. This makes it easier for me to understand the changes

/author

@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Jul 20, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.

If you need a review, please ensure CI is green and the PR is rebased on the latest master. Don't hesitate to ping the maintainers - either @core on Discord or by mentioning them directly here on the PR.

Thank you for your contribution!

@github-actions github-actions Bot added the S-stale Inactive issue or pull request label Jul 28, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

This pull request was automatically closed because it has been inactive for 14 days. Feel free to reopen it if you'd like to continue working on it.

@github-actions github-actions Bot closed this Aug 4, 2026
@slbotbm slbotbm reopened this Aug 4, 2026
@github-actions github-actions Bot removed the S-stale Inactive issue or pull request label Aug 4, 2026
@slbotbm

slbotbm commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Since the original author has stopped responding, I'll take over and complete this PR.

@slbotbm
slbotbm force-pushed the feat/add-python-stream-management-functions branch from e2ce0d9 to 876ebcb Compare August 4, 2026 08:32
@slbotbm

slbotbm commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

I added test clean up code as well.

/ready

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels Aug 4, 2026
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] Add functions related to stream management

3 participants