Open nalimilan opened 9 years ago
I guess a related issue it that the error should mention the lift
and skipnull
arguments. I can make a PR for that it you like.
Ah yes, I remember this. I told myself I'd make a note of this and fix it. That didn't happen.
What's going on is that there is a part of the NullableArrays
mapreduce
interface that checks whether or not any of the entries in the argument array X
is null and, if not, passes X.values
, along with function/operation to be mapreduced, to the mapreduce
interface in Base. My primary intention in that move was to boost performance, but it appears I forgot to add a check for the value of skipnull
.
I don't know if we need to change the error if the documentation makes it clear that this behavior is to be expected. This also plays into other conversations about whether or not skipnull
should be set to true
or false
by default.
I'd say:
1) Change map
to work when no values are missing.
2) Add details to the error message to mention the fact that a missing value was encountered and that skipnull=false
. Even if the docs mention this, the user who did not expect missing values in the input, or forgot to pass skipnull
, could be confused by the error about a missing method. I guess the fundamental issue here is that map
/mapreduce
have lifting semantics in some cases, but those of a standard call in others.
@johnmyleswhite I still don't understand the technical details of custom error messages possibly incurring performance penalties due to heap allocations, so I'm deferring to you on whether or not adding our own error message here is a good/bad idea.
AFAIK, The only case in which any of map
, mapreduce
or broadcast
automatically lift is the case in which one mapreduce
s over a NullableArray
that has zero null entries. I think it may be just as confusing to have map
and friends lift by default when there are no null entries but not lift by default when there are null entries -- although this actually is a lifting system that I hadn't ever really thought about.
mapreduce
works when no missing values are present in aNullableArray
, butmap
doesn't. None of them work when a missing value is present. Not sure what's the intended behavior.