BUG: Fix bad error message for element_of.

It referred to the wrong method name (`is_element`).
This commit is contained in:
Scott Sanderson
2016-05-10 16:57:59 -04:00
parent 10daf9efd6
commit 2431aaefb5
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -434,7 +434,7 @@ class ClassifierTestCase(BasePipelineTestCase):
errmsg = str(e.exception)
expected = (
"Found self.missing_value ('not in the array') in choices"
" supplied to C.is_element().\n"
" supplied to C.element_of().\n"
"Missing values have NaN semantics, so the requested"
" comparison would always produce False.\n"
"Use the isnull() method to check for missing values.\n"
@@ -447,7 +447,7 @@ class ClassifierTestCase(BasePipelineTestCase):
class C(Classifier):
dtype = dtype_
missing_value = ''
missing_value = dtype.type('1')
inputs = ()
window_length = 0
+2 -1
View File
@@ -246,7 +246,7 @@ class Classifier(RestrictedDTypeMixin, ComputableTerm):
if self.missing_value in choices:
raise ValueError(
"Found self.missing_value ({mv!r}) in choices supplied to"
" {typename}.is_element().\n"
" {typename}.{meth_name}().\n"
"Missing values have NaN semantics, so the"
" requested comparison would always produce False.\n"
"Use the isnull() method to check for missing values.\n"
@@ -254,6 +254,7 @@ class Classifier(RestrictedDTypeMixin, ComputableTerm):
mv=self.missing_value,
typename=(type(self).__name__),
choices=sorted(choices),
meth_name=self.element_of.__name__,
)
)