mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-28 11:18:19 +08:00
BUG: Fix bad error message for element_of.
It referred to the wrong method name (`is_element`).
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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__,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user