Skip to content

Commit 93a5305

Browse files
aitapTysonStanleyMichaelChirico
authored
Replace isFrame with the new API isDataFrame (#6850)
* Replace isFrame with the new API isDataFrame Since both the NOTE and the new entry point are in current R-devel, test for both R version and SVN revision to account for revisions that lack both the NOTE and the new entry point. Co-Authored-By: Tyson Barrett <[email protected]> * Add a TODO --------- Co-authored-by: Tyson Barrett <[email protected]> Co-authored-by: Michael Chirico <[email protected]>
1 parent df59c7d commit 93a5305

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/data.table.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#if R_VERSION < R_Version(3, 4, 0)
1818
# define SET_GROWABLE_BIT(x) // #3292
1919
#endif
20+
// TODO: remove the `R_SVN_VERSION` check when R 4.5.0 is released (circa Apr. 2025)
21+
#if R_VERSION < R_Version(4, 5, 0) || R_SVN_REVISION < 86702
22+
# define isDataFrame(x) isFrame(x) // #6180
23+
#endif
2024
#include <Rinternals.h>
2125
#define SEXPPTR_RO(x) ((const SEXP *)DATAPTR_RO(x)) // to avoid overhead of looped STRING_ELT and VECTOR_ELT
2226
#include <stdint.h> // for uint64_t rather than unsigned long long

src/dogroups.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
283283
for (int j=0; j<LENGTH(jval); ++j) {
284284
thiscol = VECTOR_ELT(jval,j);
285285
if (isNull(thiscol)) continue;
286-
if (!isVector(thiscol) || isFrame(thiscol))
286+
if (!isVector(thiscol) || isDataFrame(thiscol))
287287
error(_("Entry %d for group %d in j=list(...) should be atomic vector or list. If you are trying something like j=list(.SD,newcol=mean(colA)) then use := by group instead (much quicker), or cbind or merge afterwards."), j+1, i+1);
288288
if (isArray(thiscol)) {
289289
SEXP dims = PROTECT(getAttrib(thiscol, R_DimSymbol));

0 commit comments

Comments
 (0)