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

fix test_remove_consecutive_interactions unit test #643

Merged
merged 5 commits into from
Mar 15, 2023
Merged
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
10 changes: 9 additions & 1 deletion tests/utils/test_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ def test_remove_consecutive_interactions(testing_data):
df = testing_data.compute()
df["session_id"] = np.random.randint(0, 3, len(df))

# generate repeated interactions
repeated = 3
rows = []
for _ in range(repeated):
new_row = [123, 42, 0.151773, 10, -2.336, 0.819, 0.025, 0.944, 0.051, [2, 3, 12], 0, 1]
rows.append(new_row)
to_add = type(df)(rows, columns=df.columns)
df = df.append(to_add, ignore_index=True)

filtered = data_utils.remove_consecutive_interactions(
df.copy(), timestamp_col="event_timestamp"
)

assert len(filtered) < len(df)
rnyak marked this conversation as resolved.
Show resolved Hide resolved
assert len(filtered) >= 97
assert len(list(filtered.columns)) == len(list(df.columns))


Expand Down