From 1bb560b38d0bc7b29a258e534d69fb54be581ce7 Mon Sep 17 00:00:00 2001 From: Nate Parsons Date: Wed, 1 May 2024 14:34:52 -0500 Subject: [PATCH] remove agg_type --- featuretools/primitives/utils.py | 12 +++--------- .../test_feature_set_calculator.py | 10 +++++----- .../tests/primitive_tests/test_direct_features.py | 2 +- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/featuretools/primitives/utils.py b/featuretools/primitives/utils.py index 8f77e068dc..bef52b66bd 100644 --- a/featuretools/primitives/utils.py +++ b/featuretools/primitives/utils.py @@ -32,16 +32,12 @@ def _get_primitives(primitive_kind): def get_aggregation_primitives(): - """Returns all aggregation primitives, regardless - of compatibility - """ + """Returns all aggregation primitives""" return _get_primitives(featuretools.primitives.AggregationPrimitive) def get_transform_primitives(): - """Returns all transform primitives, regardless - of compatibility - """ + """Returns all transform primitives""" return _get_primitives(featuretools.primitives.TransformPrimitive) @@ -57,9 +53,7 @@ def get_all_primitives(): def _get_natural_language_primitives(): - """Returns all Natural Language transform primitives, - regardless of compatibility - """ + """Returns all Natural Language transform primitives""" transform_primitives = get_transform_primitives() def _natural_language_in_input_type(primitive): diff --git a/featuretools/tests/computational_backend/test_feature_set_calculator.py b/featuretools/tests/computational_backend/test_feature_set_calculator.py index d8bf5880a9..99afe56ffc 100644 --- a/featuretools/tests/computational_backend/test_feature_set_calculator.py +++ b/featuretools/tests/computational_backend/test_feature_set_calculator.py @@ -937,7 +937,7 @@ class SumTimesN(AggregationPrimitive): def __init__(self, n): self.n = n - def get_function(self, agg_type="pandas"): + def get_function(self): def my_function(values): return values.sum() * self.n @@ -1001,7 +1001,7 @@ class Sum1(AggregationPrimitive): stack_on_exclude = [Count] default_value = 0 - def get_function(self, agg_type="pandas"): + def get_function(self): return np.sum class Sum2(AggregationPrimitive): @@ -1014,7 +1014,7 @@ class Sum2(AggregationPrimitive): stack_on_exclude = [Count] default_value = 0 - def get_function(self, agg_type="pandas"): + def get_function(self): return np.sum class Sum3(AggregationPrimitive): @@ -1027,7 +1027,7 @@ class Sum3(AggregationPrimitive): stack_on_exclude = [Count] default_value = 0 - def get_function(self, agg_type="pandas"): + def get_function(self): return np.sum f5 = Feature( @@ -1139,7 +1139,7 @@ class ErrorPrim(AggregationPrimitive): input_types = [ColumnSchema(semantic_tags={"numeric"})] return_type = ColumnSchema(semantic_tags={"numeric"}) - def get_function(self, agg_type="pandas"): + def get_function(self): def error(s): raise RuntimeError(error_msg) diff --git a/featuretools/tests/primitive_tests/test_direct_features.py b/featuretools/tests/primitive_tests/test_direct_features.py index 4bcc5ea517..b64a44f1c3 100644 --- a/featuretools/tests/primitive_tests/test_direct_features.py +++ b/featuretools/tests/primitive_tests/test_direct_features.py @@ -144,7 +144,7 @@ class ThreeMostCommonCat(AggregationPrimitive): return_type = ColumnSchema(semantic_tags={"category"}) number_output_features = 3 - def get_function(self, agg_type="pandas"): + def get_function(self): def pd_top3(x): counts = x.value_counts() counts = counts[counts > 0]