featuretools icon indicating copy to clipboard operation
featuretools copied to clipboard

Add tests that confirm primitive input_types are the expected shapes

Open tamargrey opened this issue 2 years ago • 5 comments

There are a number of assumptions we make about the shape of Primitive input_types lists:

  • Its either a list of ColumnSchema objects or a list of lists of ColumnSchema objects (and not a combination)
  • All sub-lists are the same length
  • No input_types list or sublist is empty

As we may need to rely on these assumptions at some point, we should add tests that confirm these assumptions for all primitives, so that if we add a Primitive that breaks any of these assumptions in the future, we are notified.

tamargrey avatar May 19 '22 17:05 tamargrey

If you don't mind can I do this? Can you give some details please? Thank you. :)

lastirembender avatar Jul 19 '22 13:07 lastirembender

@lastirembender sure, what details you do you? This is an issue to make sure that all primitives in Featuretools and user created primitives get checked on their input_types attribute.

gsheni avatar Jul 19 '22 17:07 gsheni

@tamargrey @gsheni may I please give this a shot too? If I may, I have a few questions:

  1. When you say checking all primitives, am I right in assuming that you are referring to the subclasses of PrimitiveBase and not instances with the exception of immediate subclasses AggregationPrimitive and TransformPrimitive?
  2. Will a separate file need to be written for these test cases or is there one that you'd want to be updated?
  3. Should I use @pytest.mark.parametrize to run separate tests on each primitive or will a loop suffice?

harshvardhanb25 avatar Jul 29 '22 06:07 harshvardhanb25

@harshvardhanb25

  1. Yes, one approach is to check classes with instances of PrimitiveBase
  2. You can add your tests to this file.
  3. Using @pytest.mark.parametrize when possible is ideal.

gsheni avatar Aug 01 '22 17:08 gsheni

@gsheni and @tamargrey Hi, I'm a newbie, and this issue seems to be unattended. I was wondering whether it can be assigned to me and I can contribute?

govarthenan avatar Mar 31 '24 17:03 govarthenan