Skip to content

TST verify return none inplace in tests/indexing #35230

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

Merged

Conversation

r-toroxel
Copy link
Contributor

verify we return none for all inplace calls in tests/indexing

related: #35210

@r-toroxel
Copy link
Contributor Author

build failed, it says

ci/run_tests.sh

ImportError while loading conftest '/home/travis/build/pandas-dev/pandas/pandas/conftest.py'.

ImportError: C extension: 'dtypes' from partially initialized module 'pandas._libs.tslibs' (most likely due to a circular import) (/home/travis/build/pandas-dev/pandas/pandas/_libs/tslibs/init.py) not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.

The command "ci/run_tests.sh" exited with 4.

@r-toroxel
Copy link
Contributor Author

had a similar issue locally and had to recompile everything ...

@@ -25,7 +25,8 @@ def test_detect_chained_assignment():

msg = "A value is trying to be set on a copy of a slice from a DataFrame"
with pytest.raises(com.SettingWithCopyError, match=msg):
zed["eyes"]["right"].fillna(value=555, inplace=True)
return_value = zed["eyes"]["right"].fillna(value=555, inplace=True)
assert return_value is None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed this one

@r-toroxel r-toroxel changed the title TST verify return none inplace indexing TST verify return none inplace in tests/indexing Jul 11, 2020

result = DataFrame(data)
expected = DataFrame.from_dict(dict(zip([0], data)), orient="index")
tm.assert_frame_equal(result, expected.reindex(result.index))
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Could you put the reindex in the expected = ... statement

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Jul 12, 2020
@simonjayhawkins
Copy link
Member

@r-toroxel Thanks for the PR. The branch has conflicts with master. can you merge upstream/master

@jreback jreback added this to the 1.1 milestone Jul 13, 2020
@jreback jreback merged commit af964ca into pandas-dev:master Jul 13, 2020
@jreback
Copy link
Contributor

jreback commented Jul 13, 2020

thanks @r-toroxel

fangchenli pushed a commit to fangchenli/pandas that referenced this pull request Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants