alamb opened a new issue #1157:
URL: https://github.com/apache/arrow-rs/issues/1157


   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   The Json writer in 
https://github.com/apache/arrow-rs/blob/master/arrow/src/json/writer.rs will 
`panic!` if it hits unsupported data types
   
   **Describe the solution you'd like**
   It would be nice if the code instead returned `Result<()>` -- so that would 
mean:
   1. Remove all `panic!` macros from `writer.rs`
   2. Remove all `unwrap()` or `expect()` that are not in the test code from 
writer.rs
   3. Get code to compile again
   
   The panic/unwrap would be replaced with something like:
   
   ```rust
   Err(ArrowError::JsonError(format!(
               "data type {:?} not supported",
               t
           ))),
   ```
   With the appropriate error message
   
   Interestingly, the `Writer` itself seems to return`Result` but I think the 
two free public functions `array_to_json_array` and 
`record_batches_to_json_rows` would need to be updated to return `Result<>` 
   
   https://docs.rs/arrow/6.5.0/arrow/json/writer/index.html#functions
   
   
   **Describe alternatives you've considered**
   A clear and concise description of any alternative solutions or features 
you've considered.
   
   **Additional context**
   As noted on 
https://github.com/apache/arrow-rs/pull/1149#discussion_r782430643


-- 
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]


Reply via email to