dragonknightk opened a new pull request, #55797:
URL: https://github.com/apache/arrow/pull/55797
### Rationale for this change
When a dplyr verb on a Table or RecordBatch is called through a wrapper that
forwards `...`, and the expression can't be translated, the user gets "object
of type 'special' is not subsettable" instead of the fallback to R or an
`arrow_not_supported` error.
In that case `match.call()` in `try_arrow_dplyr()` fails, so `call` is never
bound. `abandon_ship()` has a guard for this, but its `get("call", envir =
env)` inherits by default and finds `base::call`, so the guard never fires.
### What changes are included in this PR?
Pass `inherits = FALSE` to that `get()`, so the guard fires when `call` was
never bound. The fallback through a wrapper that forwards `...` still does not
work, because the call can't be captured there.
### Are these changes tested?
Yes. A Table passed through wrappers that forward `...` around `summarise()`
and `mutate()`, with an untranslatable expression, now raises
`arrow_not_supported` and includes the "Call collect() first to pull data into
R" hint. Without the fix both raise "object of type 'special' is not
subsettable".
### Are there any user-facing changes?
Yes. Through a wrapper that forwards `...`, a Table or RecordBatch now
raises `arrow_not_supported` with the hint to call `collect()`, the same as a
Dataset already does. It no longer raises "object of type 'special' is not
subsettable", and it no longer pulls the data into R first.
Closes #55793.
### Was AI used for this PR?
In accordance to the [AI generation
guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code),
please disclose below whether and how AI was used in this PR.
**PR code and description written by:**
- [x] Human
- [x] AI
**Reviewed before submission by:**
- [x] Human
- [x] AI
Grok Bot assisted with the implementation and tests. All submitted content
was reviewed line by line and verified by dragonknightk.
* GitHub Issue: (filled in automatically from the PR title)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]