Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Dec 23, 2025

Rationale for this change

Two TODOs in test-dplyr-join.R (lines 191-192) requested test coverage for edge cases in join operations. These TODOs were added in commit c273ea7.

What changes are included in this PR?

Added one test case to r/tests/testthat/test-dplyr-join.R for duplicate columns, and added a comment about type casting because it seems it disallows the type cast. Here is example error message:

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-dplyr-join.R:238:3'): joins with type casting between int and float ──
Error in `compute.arrow_dplyr_query(x)`: Invalid: Incompatible data types for corresponding join field keys: FieldRef.Name(x) of type int32 and FieldRef.Name(x) of type double
Backtrace:
     ▆
  1. ├─arrow:::compare_dplyr_binding(...) at test-dplyr-join.R:238:3
  2. │ ├─testthat::expect_warning(...) at ./helper-expectation.R:95:3
  3. │ │ └─testthat:::expect_condition_matching_(...)
  4. │ │   └─testthat:::quasi_capture(...)
  5. │ │     ├─testthat (local) .capture(...)
  6. │ │     │ └─base::withCallingHandlers(...)
  7. │ │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
  8. │ └─rlang::eval_tidy(expr, rlang::new_data_mask(rlang::env(.input = arrow_table(tbl))))
  9. ├─dplyr::collect(left_join(.input, right_float, by = "x"))
 10. └─arrow:::collect.arrow_dplyr_query(...)
 11.   └─arrow:::compute.arrow_dplyr_query(x)
 12.     └─base::tryCatch(...)
 13.       └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 14.         └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 15.           └─value[[3L]](cond)
 16.             └─arrow:::augment_io_error_msg(e, call, schema = schema())
 17.               └─rlang::abort(msg, call = call)

Therefore this PR removes that todo.

Are these changes tested?

Yes, tests were added.

Are there any user-facing changes?

No, test-only.

@github-actions
Copy link

⚠️ GitHub issue #48629 has been automatically assigned in GitHub to PR creator.

@HyukjinKwon HyukjinKwon marked this pull request as draft December 23, 2025 06:08
@HyukjinKwon HyukjinKwon changed the title GH-48629: [R] Add test coverage for joins with duplicate columns and type casting GH-48629: [R] Add test coverage for joins with duplicate columns with a comment Dec 23, 2025
@HyukjinKwon HyukjinKwon changed the title GH-48629: [R] Add test coverage for joins with duplicate columns with a comment GH-48629: [R] Add test coverage for joins with duplicate columns and type casting Dec 23, 2025
@HyukjinKwon HyukjinKwon changed the title GH-48629: [R] Add test coverage for joins with duplicate columns and type casting GH-48629: [R] Add test coverage for joins with duplicate columns with a comment Dec 23, 2025
@HyukjinKwon HyukjinKwon changed the title GH-48629: [R] Add test coverage for joins with duplicate columns with a comment GH-48629: [R] Add test coverage for joins with duplicate columns with removing a todo Dec 23, 2025
@HyukjinKwon HyukjinKwon marked this pull request as ready for review December 23, 2025 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant