Skip to content

Commit 90e5b28

Browse files
committed
Undo assert_ functions for strict checking
1 parent 3c039a2 commit 90e5b28

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

pandas/_testing/asserters.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def assert_dict_equal(left, right, compare_keys: bool = True) -> None:
181181
def assert_index_equal(
182182
left: Index,
183183
right: Index,
184-
exact: bool | Literal["equiv"] = True,
184+
exact: bool | str = "equiv",
185185
check_names: bool = True,
186186
check_exact: bool = True,
187187
check_categorical: bool = True,
@@ -203,9 +203,6 @@ def assert_index_equal(
203203
Whether to check the Index class, dtype and inferred_type
204204
are identical. If 'equiv', then RangeIndex can be substituted for
205205
Index with an int64 dtype as well.
206-
207-
.. versionchanged:: 3.0
208-
The default changed from ``'equiv'`` to ``True``
209206
check_names : bool, default True
210207
Whether to check the names attribute.
211208
check_exact : bool, default True
@@ -471,7 +468,6 @@ def assert_categorical_equal(
471468
_check_isinstance(left, right, Categorical)
472469

473470
exact: bool | str
474-
# TODO: Can this be made strict?
475471
if isinstance(left.categories, RangeIndex) or isinstance(
476472
right.categories, RangeIndex
477473
):
@@ -817,7 +813,7 @@ def assert_series_equal(
817813
left,
818814
right,
819815
check_dtype: bool | Literal["equiv"] = True,
820-
check_index_type: bool | Literal["equiv"] = True,
816+
check_index_type: bool | Literal["equiv"] = "equiv",
821817
check_series_type: bool = True,
822818
check_names: bool = True,
823819
check_exact: bool | lib.NoDefault = lib.no_default,
@@ -847,9 +843,6 @@ def assert_series_equal(
847843
check_index_type : bool or {'equiv'}, default 'equiv'
848844
Whether to check the Index class, dtype and inferred_type
849845
are identical.
850-
851-
.. versionchanged:: 3.0
852-
The default changed from ``'equiv'`` to ``True``
853846
check_series_type : bool, default True
854847
Whether to check the Series class is identical.
855848
check_names : bool, default True
@@ -1112,8 +1105,8 @@ def assert_frame_equal(
11121105
left,
11131106
right,
11141107
check_dtype: bool | Literal["equiv"] = True,
1115-
check_index_type: bool | Literal["equiv"] = True,
1116-
check_column_type: bool | Literal["equiv"] = True,
1108+
check_index_type: bool | Literal["equiv"] = "equiv",
1109+
check_column_type: bool | Literal["equiv"] = "equiv",
11171110
check_frame_type: bool = True,
11181111
check_names: bool = True,
11191112
by_blocks: bool = False,
@@ -1143,19 +1136,13 @@ def assert_frame_equal(
11431136
Second DataFrame to compare.
11441137
check_dtype : bool, default True
11451138
Whether to check the DataFrame dtype is identical.
1146-
check_index_type : bool or {'equiv'}, default True
1139+
check_index_type : bool or {'equiv'}, default 'equiv'
11471140
Whether to check the Index class, dtype and inferred_type
11481141
are identical.
1149-
1150-
.. versionchanged:: 3.0
1151-
The default changed from ``'equiv'`` to ``True``
1152-
check_column_type : bool or {'equiv'}, default True
1142+
check_column_type : bool or {'equiv'}, default 'equiv'
11531143
Whether to check the columns class, dtype and inferred_type
11541144
are identical. Is passed as the ``exact`` argument of
11551145
:func:`assert_index_equal`.
1156-
1157-
.. versionchanged:: 3.0
1158-
The default changed from ``'equiv'`` to ``True``
11591146
check_frame_type : bool, default True
11601147
Whether to check the DataFrame class is identical.
11611148
check_names : bool, default True

0 commit comments

Comments
 (0)