Skip to content

Commit

Permalink
avoid current_vis expire upon expire_recs (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
dorisjlee committed Feb 20, 2021
1 parent b1a1048 commit dfa64eb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion lux/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def expire_recs(self):
"""
self._recs_fresh = False
self._recommendation = {}
self.current_vis = None
self._widget = None
self._rec_info = None
self._sampled = None
Expand Down
15 changes: 15 additions & 0 deletions tests/test_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,18 @@ def test_similarity2():
)
)[0]
assert morrisville_vis.score > watertown_vis.score


def test_intent_retained():
df = pd.read_csv("https://raw.githubusercontent.com/lux-org/lux-datasets/master/data/employee.csv")
df.intent = ["Attrition"]
df._repr_html_()

df["%WorkingYearsAtCompany"] = df["YearsAtCompany"] / df["TotalWorkingYears"]
assert df.current_vis != None
assert df.intent != None
assert df._recs_fresh == False
assert df._metadata_fresh == False

df._repr_html_()
assert list(df.recommendation.keys()) == ["Enhance", "Filter"]

0 comments on commit dfa64eb

Please sign in to comment.