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/26 22:41:34 UTC

[GitHub] [arrow] nealrichardson commented on a change in pull request #10381: ARROW-12722: [R] Raise error when attemping to print table with duplicated naming

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



##########
File path: r/R/dplyr.R
##########
@@ -74,7 +74,13 @@ print.arrow_dplyr_query <- function(x, ...) {
     name <- expr$field_name
     if (nzchar(name)) {
       # Just a field_ref, so look up in the schema
-      schm$GetFieldByName(name)$type$ToString()
+      field_name <- schm$GetFieldByName(name)

Review comment:
       I checked with @bkietz and (currently at least) evaluating expressions on a dataset with duplicated field names will error, so if that's the case (perhaps you could verify), we should check this sooner than the print method. How about instead we put a check around L33 above, like
   
   ```r
   if (anyDuplicated(names(.data))) {
     abort("useful message")
   }
   ```




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