dedupe icon indicating copy to clipboard operation
dedupe copied to clipboard

ExistsType subclasses CategoricalType which requires categories

Open ArVar opened this issue 1 year ago • 2 comments

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.

ArVar avatar Jun 28 '24 14:06 ArVar

Just got a second view. Other Options might be:

  • remove super().__init__(field, **kwargs)
  • inherit directly from FieldType

ArVar avatar Jun 28 '24 14:06 ArVar

thanks! I'll fix that up!

fgregg avatar Jun 28 '24 15:06 fgregg