Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayThorve committed May 30, 2023
1 parent a2c7977 commit 8c7bd14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/cuxfilter/tests/assets/test_gpu_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,6 @@ def test_aggregated_column_unique():
bc.min_value = df["key"].min()

assert np.array_equal(
gpu_histogram.aggregated_column_unique(bc, df),
np.sort(np.array(gpu_histogram.aggregated_column_unique(bc, df))),
np.array([0, 4, 9, 10, 14, 21, 22, 24, 26, 29, 34, 38, 98, 103, 108]),
)
2 changes: 1 addition & 1 deletion python/cuxfilter/tests/charts/core/test_core_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_box_selection_callback(
self.result = None

def t_function(data, edges=None, patch_update=False):
self.result = data.reset_index(drop=True)
self.result = data.sort_values(by="vertex").reset_index(drop=True)

bg.reload_chart = t_function

Expand Down
12 changes: 10 additions & 2 deletions python/cuxfilter/tests/charts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ def initialize_df(type, *df_args):


def df_equals(df1, df2):
df1 = df1.compute() if isinstance(df1, dask_cudf.DataFrame) else df1
df2 = df2.compute() if isinstance(df2, dask_cudf.DataFrame) else df2
df1 = (
df1.compute().reset_index(drop=True)
if isinstance(df1, dask_cudf.DataFrame)
else df1
)
df2 = (
df2.compute().reset_index(drop=True)
if isinstance(df2, dask_cudf.DataFrame)
else df2
)

return df1.equals(df2)

Expand Down

0 comments on commit 8c7bd14

Please sign in to comment.