nealrichardson commented on a change in pull request #9092:
URL: https://github.com/apache/arrow/pull/9092#discussion_r551556251



##########
File path: r/R/record-batch.R
##########
@@ -274,6 +274,12 @@ as.data.frame.RecordBatch <- function(x, row.names = NULL, 
optional = FALSE, ...
 }
 
 .serialize_arrow_r_metadata <- function(x) {
+  # drop problems attributes (most likely from readr)
+  if ("attributes" %in% names(x) &&
+      "problems" %in% names(x[["attributes"]]) ) {
+    x[["attributes"]][["problems"]] <- NULL
+  }
+

Review comment:
       I would have to look into the implementation to be sure, but I think the 
intent of the first test should be that we don't save garbage `r` metadata and 
the second would be that, if someone happened to have bad metadata stored in 
the `r` key (we can't prevent some other data generating process from doing 
that), that we don't crash on loading it. It's not clear that that's actually 
what those tests are doing, but that's what I think they should do.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to