Skip to content

Commit

Permalink
Updating C API Entry Points: isFrame -> isDataFrame (#6235)
Browse files Browse the repository at this point in the history
* change use of isFrame to isDataFrame

* add definition of isDataFrame for older R versions

---------

Co-authored-by: Michael Chirico <chiricom@google.com>
  • Loading branch information
TysonStanley and MichaelChirico authored Jul 11, 2024
1 parent 5a091b1 commit b5ef7ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/data.table.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#if !defined(R_VERSION) || R_VERSION < R_Version(3, 4, 0)
# define SET_GROWABLE_BIT(x) // #3292
#endif
#if !defined(R_VERSION) || R_VERSION < R_Version(4, 5, 0)
# define isDataFrame(x) isFrame(x)
#endif
#include <Rinternals.h>
#define SEXPPTR_RO(x) ((const SEXP *)DATAPTR_RO(x)) // to avoid overhead of looped STRING_ELT and VECTOR_ELT
#include <stdint.h> // for uint64_t rather than unsigned long long
Expand Down
2 changes: 1 addition & 1 deletion src/dogroups.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
for (int j=0; j<LENGTH(jval); ++j) {
thiscol = VECTOR_ELT(jval,j);
if (isNull(thiscol)) continue;
if (!isVector(thiscol) || isFrame(thiscol))
if (!isVector(thiscol) || isDataFrame(thiscol))
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);
if (isArray(thiscol)) {
SEXP dims = PROTECT(getAttrib(thiscol, R_DimSymbol));
Expand Down

0 comments on commit b5ef7ce

Please sign in to comment.