Skip to content

feat(python): expose structured IggyError - #3696

Open
mmmmxa wants to merge 10 commits into
apache:masterfrom
mmmmxa:feat/python-structured-iggy-error
Open

feat(python): expose structured IggyError#3696
mmmmxa wants to merge 10 commits into
apache:masterfrom
mmmmxa:feat/python-structured-iggy-error

Conversation

@mmmmxa

@mmmmxa mmmmxa commented Jul 18, 2026

Copy link
Copy Markdown

Which issue does this PR address?

Closes #3618

Rationale

Introduce IggyError class in Python SDK to fully represent Iggy-specific errors from Rust. (See issue for more info)

What changed?

Python was exposing Iggy failures as plain RuntimeError or ValueError with only a message, while no code and snake case error name was provided.

The changes introduce the IggyError Python class that represent IggyError in Rust 1 to 1. Thus, it has code, message and the snake case error name, which gives more transparency in debugging and more information for clean exception handling.

Local Execution

  • Passed
  • Pre-commit hooks ran

AI Usage

  1. Which tools? (e.g., GitHub Copilot, Claude, ChatGPT) - Claude
  2. Scope of usage? (e.g., autocomplete, generated functions, entire implementation) - autocomplete, mass updates of some test cases, documentation generation.
  3. How did you verify the generated code works correctly? - The generated code is either tested or a part of tests, which all pass. I have also performed multiple self-reviews.
  4. Can you explain every line of the code if asked? - Yes.

@mmmmxa mmmmxa changed the title Feat/python structured iggy error feat(python): expose structured iggy error Jul 18, 2026
@mmmmxa mmmmxa changed the title feat(python): expose structured iggy error feat(python): expose structured IggyError Jul 18, 2026
@mmmmxa
mmmmxa marked this pull request as ready for review July 18, 2026 10:21
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jul 18, 2026
@mmmmxa

mmmmxa commented Jul 18, 2026

Copy link
Copy Markdown
Author

/ready

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.20690% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.99%. Comparing base (6f1d548) to head (8d2402f).
⚠️ Report is 45 commits behind head on master.

Files with missing lines Patch % Lines
foreign/python/src/error.rs 58.82% 7 Missing ⚠️
foreign/python/src/identifier.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3696      +/-   ##
============================================
- Coverage     73.99%   73.99%   -0.01%     
  Complexity      937      937              
============================================
  Files          1301     1302       +1     
  Lines        147393   147405      +12     
  Branches     122945   122945              
============================================
+ Hits         109063   109070       +7     
- Misses        34858    34863       +5     
  Partials       3472     3472              
Components Coverage Δ
Rust Core 74.29% <ø> (ø)
Java SDK 62.44% <ø> (ø)
C# SDK 72.18% <ø> (ø)
Python SDK 91.73% <86.20%> (-0.44%) ⬇️
PHP SDK 84.29% <ø> (ø)
Node SDK 91.26% <ø> (ø)
Go SDK 42.87% <ø> (ø)
Files with missing lines Coverage Δ
foreign/python/src/client.rs 98.99% <100.00%> (-0.01%) ⬇️
foreign/python/src/consumer.rs 81.15% <100.00%> (+0.61%) ⬆️
foreign/python/src/lib.rs 100.00% <100.00%> (ø)
foreign/python/src/send_message.rs 96.77% <100.00%> (ø)
foreign/python/src/identifier.rs 76.47% <75.00%> (-1.31%) ⬇️
foreign/python/src/error.rs 58.82% <58.82%> (ø)
🚀 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.

@slbotbm

slbotbm commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

@mmmmxa Will come back to this once all existing python sdk PRs are merged since they will require aligning the error types to the struct introduced here.

@slbotbm

slbotbm commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

/request-review @slbotbm

@github-actions
github-actions Bot requested a review from slbotbm July 19, 2026 08:56
@mmmmxa

mmmmxa commented Jul 19, 2026

Copy link
Copy Markdown
Author

@slbotbm Could you please let me know when it’s going to happen? Or let me know a way of finding out when should I merge the master and make same changes to the new code as well?

@slbotbm

slbotbm commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

sure, when the other prs are merged, i'll review yours and ping you

@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 27, 2026

@slbotbm slbotbm 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.

The docs for the methods are not updated. Please update them to include IggyError in them as well. If the methods are following the old way of documentation with 1-2 lines of docs, could you update them to follow the new way that aligns with normal python lib docs as well please?

@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 S-stale Inactive issue or pull request labels Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author PR is waiting on author response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose structured IggyError in Python

2 participants