From 76994cef6cb1cfd1bb1bb8645401c4078b71ba76 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Wed, 4 Mar 2026 21:38:33 +0000 Subject: [PATCH 1/3] chore: add branch placeholder zbobr_fix-28-deprecate-reply-options --- .zbobr/zbobr_fix-28-deprecate-reply-options | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .zbobr/zbobr_fix-28-deprecate-reply-options diff --git a/.zbobr/zbobr_fix-28-deprecate-reply-options b/.zbobr/zbobr_fix-28-deprecate-reply-options new file mode 100644 index 00000000..e69de29b From 7021a8e814a761440894bde99fa1df4ba0374c6f Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Wed, 4 Mar 2026 21:38:33 +0000 Subject: [PATCH 2/3] deprecate priority and congestion_control in Query.reply/reply_del Align with upstream zenoh#2382: these QoS parameters on reply builders are deprecated because response QoS now automatically matches the original query's QoS to avoid priority inversion. - Add DeprecationWarning when congestion_control or priority is passed - Remove these params from build! macro calls (no longer forwarded) - Update .pyi stubs with .. deprecated:: notices Co-Authored-By: Claude Opus 4.6 --- src/query.rs | 30 +++++++++++++++++++++++++----- zenoh/__init__.pyi | 8 ++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/query.rs b/src/query.rs index 8f429357..05f1391f 100644 --- a/src/query.rs +++ b/src/query.rs @@ -24,7 +24,7 @@ use crate::{ cancellation::CancellationToken, handlers::{into_handler, HandlerImpl}, key_expr::KeyExpr, - macros::{build, downcast_or_new, enum_mapper, option_wrapper, wrapper}, + macros::{build, downcast_or_new, enum_mapper, import, option_wrapper, wrapper}, matching::{MatchingListener, MatchingStatus}, qos::{CongestionControl, Priority}, sample::SourceInfo, @@ -144,11 +144,21 @@ impl Query { #[pyo3(from_py_with = ZBytes::from_py_opt)] attachment: Option, timestamp: Option, ) -> PyResult<()> { + if congestion_control.is_some() { + import!(py, warnings.warn).call1(( + "congestion_control in Query.reply is deprecated, it will be ignored", + py.get_type::(), + ))?; + } + if priority.is_some() { + import!(py, warnings.warn).call1(( + "priority in Query.reply is deprecated, it will be ignored", + py.get_type::(), + ))?; + } let build = build!( self.get_ref()?.reply(key_expr, payload), encoding, - congestion_control, - priority, express, attachment, timestamp, @@ -179,10 +189,20 @@ impl Query { #[pyo3(from_py_with = ZBytes::from_py_opt)] attachment: Option, timestamp: Option, ) -> PyResult<()> { + if congestion_control.is_some() { + import!(py, warnings.warn).call1(( + "congestion_control in Query.reply_del is deprecated, it will be ignored", + py.get_type::(), + ))?; + } + if priority.is_some() { + import!(py, warnings.warn).call1(( + "priority in Query.reply_del is deprecated, it will be ignored", + py.get_type::(), + ))?; + } let build = build!( self.get_ref()?.reply_del(key_expr), - congestion_control, - priority, express, attachment, timestamp, diff --git a/zenoh/__init__.pyi b/zenoh/__init__.pyi index 710644f9..29a73e67 100644 --- a/zenoh/__init__.pyi +++ b/zenoh/__init__.pyi @@ -853,6 +853,10 @@ class Query: .. note:: See the class documentation for important details about which key expression to use for replies. + + .. deprecated:: + The ``congestion_control`` and ``priority`` parameters are deprecated and will be ignored. + Response QoS now automatically matches the original query's QoS to avoid priority inversion. """ def reply_err(self, payload: _IntoZBytes, *, encoding: _IntoEncoding | None = None): @@ -874,6 +878,10 @@ class Query: .. note:: See the class documentation for important details about which key expression to use for replies. + + .. deprecated:: + The ``congestion_control`` and ``priority`` parameters are deprecated and will be ignored. + Response QoS now automatically matches the original query's QoS to avoid priority inversion. """ @_unstable From aa1af17ae026fbb489ea84c18f140b7d3c7becd2 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Thu, 5 Mar 2026 15:17:37 +0100 Subject: [PATCH 3/3] dummy file removed --- .zbobr/zbobr_fix-28-deprecate-reply-options | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .zbobr/zbobr_fix-28-deprecate-reply-options diff --git a/.zbobr/zbobr_fix-28-deprecate-reply-options b/.zbobr/zbobr_fix-28-deprecate-reply-options deleted file mode 100644 index e69de29b..00000000