Jefffrey commented on code in PR #11402:
URL: https://github.com/apache/arrow-rs/pull/11402#discussion_r4203563675
##########
parquet-variant-json/src/to_json.rs:
##########
@@ -365,6 +359,16 @@ fn format_time_ntz_str(time: &chrono::NaiveTime) -> String
{
}
}
+/// Maps a [`serde_json`] serialization failure, keeping writer failures as
+/// [`ArrowError::IoError`] just like [`write!`] does
+fn json_encoding_error(context: &str, error: serde_json::Error) -> ArrowError {
+ if error.is_io() {
+ ArrowError::IoError(error.to_string(), std::io::Error::other(error))
Review Comment:
```suggestion
ArrowError::IoError(error.to_string(), error.into())
```
since `serde_json::Error` implements `From<serde_json::Error> for io::Error`
https://docs.rs/serde_json/latest/serde_json/struct.Error.html#impl-From%3CError%3E-for-Error
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]