You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "officialasishkumar (via GitHub)" <gi...@apache.org> on 2026/05/25 03:54:05 UTC

[PR] feat(core): implement debug for readers and writers [opendal]

officialasishkumar opened a new pull request, #7616:
URL: https://github.com/apache/opendal/pull/7616

   # Which issue does this PR close?
   
   Closes #6076.
   
   # Rationale for this change
   
   `Reader` and `Writer` are useful to store inside downstream types that require `Debug`, and their current lack of debug output also makes operation context harder to inspect.
   
   # What changes are included in this PR?
   
   - Implement `Debug` for `Reader` and `Writer` using existing operation context.
   - Implement `Debug` for `FuturesAsyncReader` and `FuturesAsyncWriter`.
   - Add focused tests for reader and writer debug output.
   - Extend trait assertions to cover the new `Debug` bounds.
   
   # Are there any user-facing changes?
   
   `Reader`, `Writer`, `FuturesAsyncReader`, and `FuturesAsyncWriter` now implement `Debug`.
   
   # AI Usage Statement
   
   Not applicable.
   


-- 
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@opendal.apache.org

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


Re: [PR] feat(core): implement debug for readers and writers [opendal]

Posted by "erickguan (via GitHub)" <gi...@apache.org>.
erickguan commented on PR #7616:
URL: https://github.com/apache/opendal/pull/7616#issuecomment-4789784118

   @officialasishkumar Can you rebase? Since there was a large refactor.


-- 
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@opendal.apache.org

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


Re: [PR] feat(core): implement debug for readers and writers [opendal]

Posted by "erickguan (via GitHub)" <gi...@apache.org>.
erickguan commented on code in PR #7616:
URL: https://github.com/apache/opendal/pull/7616#discussion_r3507761315


##########
core/core/src/types/read/reader.rs:
##########
@@ -649,7 +664,28 @@ mod tests {
         let srv = op.service().clone();
         let ctx = new_read_context(ctx, srv, "test", OpReader::new())?;
 
-        let _: Box<dyn Unpin + MaybeSend + Sync + 'static> = Box::new(Reader::new(ctx));
+        fn assert_reader_traits<T: std::fmt::Debug + Unpin + MaybeSend + Sync + 'static>(_: &T) {}
+
+        let reader = Reader::new(ctx);
+        assert_reader_traits(&reader);
+        let _: Box<dyn Unpin + MaybeSend + Sync + 'static> = Box::new(reader);
+
+        Ok(())
+    }
+
+    #[tokio::test]
+    async fn test_debug() -> Result<()> {

Review Comment:
   I'm fine not to test debug. It's pretty evident.
   
   You could take evcxr to do the same thing if you want to read symbols.



##########
core/core/src/types/read/futures_async_reader.rs:
##########
@@ -215,8 +234,10 @@ mod tests {
         let srv = op.service().clone();
         let ctx = Arc::new(new_read_context(ctx, srv, "test", OpReader::new())?);
 
-        let v = FuturesAsyncReader::new(ctx, 4..8);
+        fn assert_reader_traits<T: std::fmt::Debug + Unpin + MaybeSend + Sync + 'static>(_: &T) {}

Review Comment:
   What is this for?



-- 
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@opendal.apache.org

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


Re: [PR] feat(core): implement debug for readers and writers [opendal]

Posted by "officialasishkumar (via GitHub)" <gi...@apache.org>.
officialasishkumar commented on PR #7616:
URL: https://github.com/apache/opendal/pull/7616#issuecomment-4851539518

   Rebased on current main in c0984ecf.


-- 
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@opendal.apache.org

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