alamb commented on code in PR #7854: URL: https://github.com/apache/arrow-rs/pull/7854#discussion_r2183158631
########## arrow-json/src/writer/mod.rs: ########## @@ -413,6 +413,18 @@ where Ok(()) } + /// Gets a reference to the underlying writer. + pub fn get_ref(&self) -> &W { + &self.writer + } + + /// Gets a mutable reference to the underlying writer. + /// + /// It is inadvisable to directly write to the underlying writer. Review Comment: I think this comment is confusing -- I imagine users would be wondering why is there an API that the documentation advises not to use Thus, I think it would be useful to explain **why** it is not advisable or remove it all together ```suggestion /// Gets a mutable reference to the underlying writer. /// /// Writing to the underlying writer must be done with care /// to avoid corrupting the output JSON. ``` I realize this is copy/paste from https://docs.rs/arrow-ipc/55.2.0/arrow_ipc/writer/struct.FileWriter.html#method.get_mut but I think JSON has fewer reasons that writing to the underlying write is problematic -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org