You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "paleolimbot (via GitHub)" <gi...@apache.org> on 2023/03/30 19:15:11 UTC

[GitHub] [arrow] paleolimbot commented on a diff in pull request #34798: GH-15247: [R] Error when trying to save a data.frame with NULL column names

paleolimbot commented on code in PR #34798:
URL: https://github.com/apache/arrow/pull/34798#discussion_r1153690130


##########
r/R/csv.R:
##########
@@ -782,12 +782,16 @@ write_csv_arrow <- function(x,
     tryCatch(
       x <- as_record_batch_reader(x),
       error = function(e) {
-        abort(
-          paste0(
-            "x must be an object of class 'data.frame', 'RecordBatch', ",
-            "'Dataset', 'Table', or 'RecordBatchReader' not '", class(x)[1], "'."
+        if (grepl("Input data frame columns must be named", conditionMessage(e))) {
+          abort(conditionMessage(e), parent = NA)

Review Comment:
   Can we in all cases pass `parent = e` here? (This will make it easier to diagnose the next time this function swallows an unrelated error by accident).



-- 
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: github-unsubscribe@arrow.apache.org

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