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

TST: test for inconsistency due to dtype=string #46512 #47793

Closed
wants to merge 40 commits into from
Closed
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5b39d02
TST
Shadimrad Jul 14, 2022
e0a27b2
TST
Shadimrad Jul 14, 2022
bd32b97
TST
Shadimrad Jul 14, 2022
48a27f8
updated strign formatting
Shadimrad Jul 14, 2022
dceccf0
updated formatting
Shadimrad Jul 14, 2022
1904094
updating the test place within files
Shadimrad Jul 15, 2022
7270b34
removing an additional parentheses
Shadimrad Jul 15, 2022
7fb362d
removing the buggy file that was pushed
Shadimrad Jul 15, 2022
e48a63d
removing the buggy file that was pushed
Shadimrad Jul 15, 2022
15be2f5
fixing initial file
Shadimrad Jul 15, 2022
204affb
fixing order of import
Shadimrad Jul 15, 2022
22843cc
fixing space
Shadimrad Jul 15, 2022
d1d0601
fixing space
Shadimrad Jul 15, 2022
c795d5d
fixing space
Shadimrad Jul 15, 2022
da73d0e
issue2
Shadimrad Jul 20, 2022
91979a4
Merge branch 'main' into issue2
Shadimrad Jul 20, 2022
d002ce0
Update test_arithmetic.py
Shadimrad Jul 20, 2022
a8146e9
test
Shadimrad Jul 20, 2022
1d3e914
Update test_where.py
Shadimrad Jul 20, 2022
e92bb7c
Update test_where.py
Shadimrad Jul 20, 2022
6d446f9
Update generic.py
Shadimrad Jul 20, 2022
8d60097
Update generic.py
Shadimrad Jul 20, 2022
007612f
Update generic.py
Shadimrad Jul 20, 2022
c655774
Update test_where.py
Shadimrad Jul 20, 2022
6df1d30
Merge branch 'main' into issue2
Shadimrad Jul 20, 2022
7cf318a
test
Shadimrad Jul 20, 2022
3452783
Update test_where.py
Shadimrad Aug 4, 2022
bcdff67
Update test_where.py
Shadimrad Aug 4, 2022
39e53f6
Merge branch 'issue2' of https://github.com/Shadimrad/pandas into issue2
Shadimrad Aug 4, 2022
ca7a705
Update test_where.py
Shadimrad Aug 4, 2022
4e9b374
do
Shadimrad Aug 4, 2022
b78896f
Update test_where.py
Shadimrad Aug 4, 2022
775f979
branch
Shadimrad Aug 4, 2022
f4dec29
fix
Shadimrad Aug 4, 2022
86b6b9a
relocate
Shadimrad Aug 4, 2022
e6a73a8
Merge branch 'main' into issue2
Shadimrad Aug 4, 2022
cfeb393
Merge branch 'main' into issue2
Shadimrad Aug 16, 2022
acffd23
Merge branch 'main' into issue2
Shadimrad Aug 17, 2022
d4ec9b5
Update test_string.py
Shadimrad Aug 18, 2022
b2a8c1f
Merge branch 'main' into issue2
Shadimrad Aug 18, 2022
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
8 changes: 8 additions & 0 deletions pandas/tests/arrays/string_/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,3 +611,11 @@ def test_setitem_scalar_with_mask_validation(dtype):
msg = "Scalar must be NA or str"
with pytest.raises(ValueError, match=msg):
ser[mask] = 1


def test_consitency_inplace():
expected = pd.DataFrame({"M": [""]}, dtype="string")
df = pd.DataFrame({"M": [""]}, dtype="string")
df.where(df != "", np.nan, inplace=True)
expected = expected.where(expected != "", np.nan)
tm.assert_frame_equal(expected, df)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my prior comment, I was referring to that there should be 2 tm.assert_frame_equal so that both inplace=True/False are tested separately e.g.

expected = pd.DataFrame({"M": [""]}, dtype="string")
df_inplace = ...
tm.assert_frame_equal(df_inplace, expected)
df_not_inplace = ...
tm.assert_frame_equal(df_not_inplace, expected)