parkma99 commented on code in PR #7091:
URL: https://github.com/apache/arrow-datafusion/pull/7091#discussion_r1275743366
##########
datafusion/proto/src/common.rs:
##########
@@ -17,26 +17,17 @@
use datafusion_common::{DataFusionError, Result};
-pub fn csv_delimiter_to_string(b: u8) -> Result<String> {
- let b = &[b];
- let b = std::str::from_utf8(b)
- .map_err(|_| DataFusionError::Internal("Invalid CSV
delimiter".to_owned()))?;
- Ok(b.to_owned())
-}
-
-pub fn str_to_byte(s: &String) -> Result<u8> {
+pub fn str_to_byte(s: &String, flag: &str) -> Result<u8> {
if s.len() != 1 {
- return Err(DataFusionError::Internal(
- "Invalid CSV delimiter".to_owned(),
- ));
+ return Err(DataFusionError::Internal(format!("Invalid CSV {flag}")));
}
Ok(s.as_bytes()[0])
}
-pub fn byte_to_string(b: u8) -> Result<String> {
+pub fn byte_to_string(b: u8, flag: &str) -> Result<String> {
Review Comment:
I am confuing about this, `str_to_bytes` is called in other file.
--
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]