Repository: dedupeio/dedupe (language: python)

Issue:
ExistsType subclasses CategoricalType which requires categories
I've tried to use the new syntax for field definitions and encountered a potential bug:

`dedupe.variables.Exists("first_name")`
doesn't work as stated in the Variable-definition.rst

The following error occurs:
> TypeError: CategoricalType.__init__() missing 1 required positional argument: 'categories'

due to `super().__init__(field, **kwargs)` referencing `CategoricalType`.

There might be different options to tackle this. As far as I've understood, it should be sufficient to hardcode 
`categories=[0, 1]` as kwarg.


Discussion / hints:
Just got a second view. Other Options might be: 
* remove `super().__init__(field, **kwargs)`
* inherit directly from FieldType
thanks! I'll fix that up!

Fix patch:
diff --git a/dedupe/variables/exists.py b/dedupe/variables/exists.py
index 00ca7eb4..72887255 100644
--- a/dedupe/variables/exists.py
+++ b/dedupe/variables/exists.py
@@ -5,11 +5,10 @@
 from categorical import CategoricalComparator
 
 from dedupe._typing import PredicateFunction
-from dedupe.variables.base import DerivedType
-from dedupe.variables.categorical_type import CategoricalType
+from dedupe.variables.base import DerivedType, FieldType
 
 
-class ExistsType(CategoricalType):
+class ExistsType(FieldType):
     type = "Exists"
     _predicate_functions: list[PredicateFunction] = []
 


Test patch:
diff --git a/tests/test_exists.py b/tests/test_exists.py
new file mode 100644
index 00000000..f4129ef3
--- /dev/null
+++ b/tests/test_exists.py
@@ -0,0 +1,13 @@
+import unittest
+
+import numpy
+
+from dedupe.variables.exists import ExistsType
+
+
+class TestExists(unittest.TestCase):
+    def test_comparator(self):
+        var = ExistsType("foo")
+        assert numpy.array_equal(var.comparator(None, None), [0, 0])
+        assert numpy.array_equal(var.comparator(1, 1), [1, 0])
+        assert numpy.array_equal(var.comparator(1, 0), [0, 1])