You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/05 13:59:15 UTC

[GitHub] [arrow-rs] hulunbier opened a new pull request #260: Fix empty Schema::metadata deserialization error

hulunbier opened a new pull request #260:
URL: https://github.com/apache/arrow-rs/pull/260


   Hope this fixes issue #241
   
   # Which issue does this PR close?
   Closes #241 
   
   # Rationale for this change
   
   De-serializing schema with empty metadata gives us a "missing field metadata..." error,  as stated in #241. returns an empty HashMap may be a better choice. 
   
   # What changes are included in this PR?
   
   Annotates field `Schema::metadata` with `#[serde(default)]`, which will give us a empty HashMap if metadata is empty.
   
   # Are there any user-facing changes?
   
   none.


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

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



[GitHub] [arrow-rs] nevi-me merged pull request #260: Fix empty Schema::metadata deserialization error

Posted by GitBox <gi...@apache.org>.
nevi-me merged pull request #260:
URL: https://github.com/apache/arrow-rs/pull/260


   


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

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



[GitHub] [arrow-rs] alamb commented on a change in pull request #260: Fix empty Schema::metadata deserialization error

Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #260:
URL: https://github.com/apache/arrow-rs/pull/260#discussion_r626650952



##########
File path: arrow/src/datatypes/schema.rs
##########
@@ -335,3 +336,35 @@ struct MetadataKeyValue {
     key: String,
     value: String,
 }
+
+#[cfg(test)]
+mod tests {
+    use crate::datatypes::DataType;
+
+    use super::*;
+
+    #[test]
+    fn test_ser_de_metadata() {

Review comment:
       In case anyone else is wondering, this test fails with the following error on master:
   
   ```
   
   ---- datatypes::schema::tests::test_ser_de_metadata stdout ----
   thread 'datatypes::schema::tests::test_ser_de_metadata' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `metadata`", line: 1, column: 284)', arrow/src/datatypes/schema.rs:355:53
   ```




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

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