You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "Jorge-Polanco-Roque (via GitHub)" <gi...@apache.org> on 2026/09/14 01:27:42 UTC

[PR] feat(python): expose update_user options [iggy]

Jorge-Polanco-Roque opened a new pull request, #4173:
URL: https://github.com/apache/iggy/pull/4173

   Closes #4164.
   
   The Python SDK's `update_user()` always passed `UserUpdateOptions::default()`, so there was no way to actually set the options the Rust API accepts. This exposes an optional `options` kwarg and forwards it into `UserUpdateOptions`, following the exact pattern already used by `update_stream()`. Omitting it keeps the previous behavior.
   
   **Tests:** added `test_update_user_with_empty_options_succeeds` and `test_update_user_forwards_options` (mirroring `test_stream.py`); the full `test_user.py` suite (53) passes against a local server, and `cargo clippy` + `ruff` are clean. The `.pyi` stub was regenerated with `stub_gen` + `ruff format`.
   
   ---
   _Disclosure: per CONTRIBUTING's AI-assistance note — I use AI to help write and review code, and I've reviewed and verified every line myself._
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(python): expose update_user options [iggy]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4173:
URL: https://github.com/apache/iggy/pull/4173#issuecomment-5657770149

   <!-- iggy-pr-triage-welcome -->
   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
   - `/pin` - exempt the PR from the stale bot, `/unpin` to undo
   
   See [CONTRIBUTING.md](https://github.com/apache/iggy/blob/master/CONTRIBUTING.md#pr-triage-commands) for details.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(python): expose update_user options [iggy]

Posted by "spetz (via GitHub)" <gi...@apache.org>.
spetz merged PR #4173:
URL: https://github.com/apache/iggy/pull/4173


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(python): expose update_user options [iggy]

Posted by "jiengup (via GitHub)" <gi...@apache.org>.
jiengup commented on code in PR #4173:
URL: https://github.com/apache/iggy/pull/4173#discussion_r4001851194


##########
foreign/python/src/client.rs:
##########
@@ -354,35 +354,37 @@ impl IggyClient {
     ///     user_id: User identifier as `str | int`.
     ///     username: New username as `str | None`; unchanged when `None`.
     ///     status: New status as `UserStatus | None`; unchanged when `None`.
+    ///     options: Additional option keys as `dict[str, str] | None`, forwarded

Review Comment:
   Let's explicitly state that this parameter is reserved for future use.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(python): expose update_user options [iggy]

Posted by "spetz (via GitHub)" <gi...@apache.org>.
spetz commented on code in PR #4173:
URL: https://github.com/apache/iggy/pull/4173#discussion_r4002989463


##########
foreign/python/tests/test_user.py:
##########
@@ -361,6 +361,39 @@ async def test_update_username_and_status_together(
 
         await iggy_client.delete_user(created.id)
 
+    @pytest.mark.asyncio
+    async def test_update_user_with_empty_options_succeeds(
+        self, iggy_client: IggyClient, unique_name
+    ):
+        """Test update_user accepts an empty options map."""
+        username, password = unique_credentials(unique_name)
+        new_username = unique_name(max_bytes=MAX_USERNAME_BYTES)
+        created = await iggy_client.create_user(username, password)
+
+        await iggy_client.update_user(created.id, username=new_username, options={})
+
+        user = await iggy_client.get_user(created.id)
+        assert user is not None
+        assert user.username == new_username
+
+        await iggy_client.delete_user(created.id)
+
+    @pytest.mark.asyncio
+    async def test_update_user_forwards_options(
+        self, iggy_client: IggyClient, unique_name
+    ):
+        """Test update_user forwards option keys to the server."""
+        username, password = unique_credentials(unique_name)
+        created = await iggy_client.create_user(username, password)
+
+        with pytest.raises(RuntimeError):

Review Comment:
   Bare `pytest.raises(RuntimeError)` passes on any RuntimeError, including an unrelated failure. Mirrors `test_update_stream_forwards_options` so it's consistent with the existing suite.



##########
foreign/python/src/client.rs:
##########
@@ -354,35 +354,37 @@ impl IggyClient {
     ///     user_id: User identifier as `str | int`.
     ///     username: New username as `str | None`; unchanged when `None`.
     ///     status: New status as `UserStatus | None`; unchanged when `None`.
+    ///     options: Additional option keys as `dict[str, str] | None`, forwarded
+    ///         to the server. Current server versions reject all user update
+    ///         option keys.
     ///
     /// Returns:
     ///     An awaitable that resolves to `None` when the user is updated.
     ///
     /// Raises:
     ///     ValueError: If a string identifier is invalid.
     ///     RuntimeError: If the request fails.
-    #[pyo3(signature = (user_id, username=None, status=None))]
+    #[pyo3(signature = (user_id, username=None, status=None, options=None))]
     #[gen_stub(override_return_type(type_repr="collections.abc.Awaitable[None]", imports=("collections.abc")))]

Review Comment:
   Signature spacing is `status=None, options=None` here but `options = None` in `update_stream`. Cosmetic, rustfmt does not touch attribute contents.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(python): expose update_user options [iggy]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #4173:
URL: https://github.com/apache/iggy/pull/4173#issuecomment-5660612473

   ## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/4173?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 87.13%. Comparing base ([`c2bd0c0`](https://app.codecov.io/gh/apache/iggy/commit/c2bd0c0cd3b227299ca441f8a650ab5bd86ebaa0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`18e7eaf`](https://app.codecov.io/gh/apache/iggy/commit/18e7eaf8e4396f9bd1f9ed86d222e518491aeac1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #4173      +/-   ##
   ============================================
   - Coverage     87.13%   87.13%   -0.01%     
     Complexity     1455     1455              
   ============================================
     Files          1273     1273              
     Lines        215301   215300       -1     
     Branches     179909   179909              
   ============================================
   - Hits         187597   187596       -1     
     Misses        23178    23178              
     Partials       4526     4526              
   ```
   
   | [Components](https://app.codecov.io/gh/apache/iggy/pull/4173/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [Rust Core](https://app.codecov.io/gh/apache/iggy/pull/4173/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `88.16% <ø> (ø)` | |
   | [Java SDK](https://app.codecov.io/gh/apache/iggy/pull/4173/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `67.58% <ø> (ø)` | |
   | [C# SDK](https://app.codecov.io/gh/apache/iggy/pull/4173/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.11% <ø> (ø)` | |
   | [Python SDK](https://app.codecov.io/gh/apache/iggy/pull/4173/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `90.97% <100.00%> (-0.01%)` | :arrow_down: |
   | [PHP SDK](https://app.codecov.io/gh/apache/iggy/pull/4173/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `85.67% <ø> (ø)` | |
   | [Node SDK](https://app.codecov.io/gh/apache/iggy/pull/4173/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `96.26% <ø> (ø)` | |
   | [Go SDK](https://app.codecov.io/gh/apache/iggy/pull/4173/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.45% <ø> (ø)` | |
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/iggy/pull/4173?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [foreign/python/src/client.rs](https://app.codecov.io/gh/apache/iggy/pull/4173?src=pr&el=tree&filepath=foreign%2Fpython%2Fsrc%2Fclient.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9weXRob24vc3JjL2NsaWVudC5ycw==) | `99.77% <100.00%> (-0.01%)` | :arrow_down: |
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org