thisisnic commented on code in PR #48634:
URL: https://github.com/apache/arrow/pull/48634#discussion_r2642332602
##########
r/src/altrep.cpp:
##########
@@ -1094,10 +1101,11 @@ SEXP MakeAltrepVector(const
std::shared_ptr<ChunkedArray>& chunked_array) {
bool is_arrow_altrep(SEXP x) {
if (ALTREP(x)) {
- SEXP info = ALTREP_CLASS_SERIALIZED_CLASS(ALTREP_CLASS(x));
- SEXP pkg = ALTREP_SERIALIZED_CLASS_PKGSYM(info);
-
- if (pkg == symbols::arrow) return true;
+ return R_altrep_inherits(x, AltrepVectorPrimitive<REALSXP>::class_t) ||
+ R_altrep_inherits(x, AltrepVectorPrimitive<INTSXP>::class_t) ||
+ R_altrep_inherits(x, AltrepFactor::class_t) ||
+ R_altrep_inherits(x, AltrepVectorString<StringType>::class_t) ||
+ R_altrep_inherits(x, AltrepVectorString<LargeStringType>::class_t);
Review Comment:
> 🤖 Trade-off: Old code automatically worked for any class registered under
"arrow" package. New code requires updating if new ALTREP types are added.
Doesn't sound like it'll be an issue?
--
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]