Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed all mentions of allow_where #587

Merged
merged 4 commits into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changelog
* Support custom variable types (:pr:`571`)
* Fixes
* Normalize_entity specifies error when 'make_time_index' is an invalid string (:pr:`550`)
* Removed all mentions of allow_where (:pr:`587`)
* Changes
* Refactor get_pandas_data_slice to take single entity (:pr:`547`)
* Updates TimeSincePrevious and Diff Primitives (:pr:`561`)
Expand All @@ -21,7 +22,7 @@ Changelog
* Miscellaneous changes (:pr:`559`, :pr:`569`, :pr:`570`, :pr:`574`, :pr:`584`)

Thanks to the following people for contributing to this release:
:user:`allisonportis`, :user:`CJStadler`, :user:`ctduffy`, :user:`gsheni`, :user:`kmax12`, :user:`rwedge`
:user:`alexjwang`, :user:`allisonportis`, :user:`CJStadler`, :user:`ctduffy`, :user:`gsheni`, :user:`kmax12`, :user:`rwedge`

**v0.8.0** May 17, 2019
* Rename NUnique to NumUnique (:pr:`510`)
Expand Down
1 change: 0 additions & 1 deletion featuretools/primitives/base/aggregation_primitive_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class AggregationPrimitive(PrimitiveBase):
base_of = None # whitelist of primitives this prim can be input for
base_of_exclude = None # primitives this primitive can't be input for
stack_on_self = True # whether or not it can be in input_types of self
allow_where = True # whether DFS can apply where clause to this primitive

def generate_name(self, base_feature_names, relationship_path_name,
parent_entity_id, where_str, use_prev_str):
Expand Down
2 changes: 0 additions & 2 deletions featuretools/primitives/base/primitive_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class PrimitiveBase(object):
#: (bool): True if feature needs to know what the current calculation time
# is (provided to computational backend as "time_last")
uses_calc_time = False
#: (bool): If True, allow where clauses in DFS
allow_where = False
#: (int): Maximum number of features in the largest chain proceeding
# downward from this feature's base features.
max_stack_depth = None
Expand Down
4 changes: 0 additions & 4 deletions featuretools/synthesis/deep_feature_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,6 @@ def _build_agg_features(self, all_features,
primitive=agg_prim)
self._handle_new_feature(new_f, all_features)

# Obey allow where
if not agg_prim.allow_where:
continue

# limit the stacking of where features
# count up the the number of where features
# in this feature and its dependencies
Expand Down
27 changes: 3 additions & 24 deletions featuretools/tests/synthesis/test_deep_feature_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,30 +536,9 @@ def test_stacking_where_primitives(es):
assert len(stacked_where_limit_2_feats) > 0


def test_allow_where(es):
es = copy.deepcopy(es)
es['sessions']['device_type'].interesting_values = [0]
Count.allow_where = False
kwargs = dict(
target_entity_id='customers',
entityset=es,
agg_primitives=[Count, Last],
max_depth=3,
)
dfs_constrained = DeepFeatureSynthesis(where_primitives=[Count, Last],
**kwargs)
features = dfs_constrained.build_features()

# change it back after building features
Count.allow_where = True

where_feats = [f for f in features
if isinstance(f, AggregationFeature) and f.where is not None]

assert len([f for f in where_feats
if isinstance(f.primitive, Last)]) > 0
assert len([f for f in where_feats
if isinstance(f.primitive, Count)]) == 0
def test_no_allow_where(es):
with pytest.raises(AttributeError):
Count.allow_where


def test_where_different_base_feats(es):
Expand Down