Skip to content

Commit edabdbb

Browse files
fix: loosen filter items tests to accomodate shifting pandas impl (#41)
1 parent 5056da6 commit edabdbb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

tests/system/small/test_dataframe.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -2129,10 +2129,10 @@ def test_df_columns_filter_items(scalars_df_index, scalars_pandas_df_index):
21292129
bf_result = scalars_df_index.filter(items=["string_col", "int64_col"]).to_pandas()
21302130

21312131
pd_result = scalars_pandas_df_index.filter(items=["string_col", "int64_col"])
2132-
2132+
# Ignore column ordering as pandas order differently depending on version
21332133
pd.testing.assert_frame_equal(
2134-
bf_result,
2135-
pd_result,
2134+
bf_result.sort_index(axis=1),
2135+
pd_result.sort_index(axis=1),
21362136
)
21372137

21382138

@@ -2167,9 +2167,11 @@ def test_df_rows_filter_items(scalars_df_index, scalars_pandas_df_index):
21672167

21682168
# Pandas uses int64 instead of Int64 (nullable) dtype.
21692169
pd_result.index = pd_result.index.astype(pd.Int64Dtype())
2170-
pd.testing.assert_frame_equal(
2170+
# Ignore ordering as pandas order differently depending on version
2171+
assert_pandas_df_equal_ignore_ordering(
21712172
bf_result,
21722173
pd_result,
2174+
check_names=False,
21732175
)
21742176

21752177

tests/system/small/test_series.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1950,9 +1950,11 @@ def test_series_filter_items(scalars_df_index, scalars_pandas_df_index):
19501950

19511951
# Pandas uses int64 instead of Int64 (nullable) dtype.
19521952
pd_result.index = pd_result.index.astype(pd.Int64Dtype())
1953-
pd.testing.assert_series_equal(
1953+
# Ignore ordering as pandas order differently depending on version
1954+
assert_series_equal_ignoring_order(
19541955
bf_result,
19551956
pd_result,
1957+
check_names=False,
19561958
)
19571959

19581960

0 commit comments

Comments
 (0)