Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

J clause now requiring (parentheses) around statements to recognize variables #1864

Closed
mlandry22-h2o opened this issue Oct 3, 2016 · 2 comments
Milestone

Comments

@mlandry22-h2o
Copy link

After upgrading to 1.9.7, a few statements that previously ran successfully now create errors due to unrecognized columns.

A workaround seems to be to wrap the statement in parentheses.

A pair of examples.

## case 1
allNumeric<-all(DT[,!is.na(as.numeric(FieldName))])   ## original
# Error in eval(expr, envir, enclos) :
# object 'FieldName' not found

allNumeric<-all(DT[,(!is.na(as.numeric(FieldName)))])   ## workaround

## case 2
dupeType[removalIndex>0,rowId-(2*removalIndex-1)]   ## original
dupeType[removalIndex>0,(rowId-(2*removalIndex-1))]   ## workaround
@MichaelChirico
Copy link
Member

MichaelChirico commented Oct 3, 2016

@mattdowle I guess this is a side-effect of the new auto-.SD-with-FALSE?

Catching ! as jsub[[1]] and assuming it was column exclusion?

DT = data.table(FieldName = c("1", "2", "3", "four", "five"))

#works fine
DT[ , is.na(as.numeric(FieldName))]
#fails, as above
DT[ , !is.na(as.numeric(FieldName))]

I'm surprised this wasn't caught by any unit tests!

@mattdowle
Copy link
Member

Yes indeed. Recent change last few days. Thanks. Was not intended. On it ...

@mattdowle mattdowle added this to the v1.9.8 milestone Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants