-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Make old tests more performant #55746
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
Changes from all commits
2f808ee
fa2e1c9
d8acdc8
76965c4
bb422c6
9b4d3ce
286bdfa
8d5eca6
6170ff7
a3fad5c
110407a
040d748
f36a67d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
import numpy as np | ||
import pytest | ||
|
||
from pandas._libs import index as libindex | ||
from pandas.errors import IndexingError | ||
import pandas.util._test_decorators as td | ||
|
||
|
@@ -1974,12 +1975,14 @@ def test_loc_drops_level(self): | |
|
||
|
||
class TestLocSetitemWithExpansion: | ||
@pytest.mark.slow | ||
def test_loc_setitem_with_expansion_large_dataframe(self): | ||
def test_loc_setitem_with_expansion_large_dataframe(self, monkeypatch): | ||
# GH#10692 | ||
result = DataFrame({"x": range(10**6)}, dtype="int64") | ||
result.loc[len(result)] = len(result) + 1 | ||
expected = DataFrame({"x": range(10**6 + 1)}, dtype="int64") | ||
size_cutoff = 50 | ||
with monkeypatch.context(): | ||
monkeypatch.setattr(libindex, "_SIZE_CUTOFF", size_cutoff) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm looking at this id actually expect us to cdef There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As long as there's an accessible Python version to override this too, SGTM. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think they're mutually exclusive, but im fine with doing this for the short-to-medium term |
||
result = DataFrame({"x": range(size_cutoff)}, dtype="int64") | ||
result.loc[size_cutoff] = size_cutoff | ||
expected = DataFrame({"x": range(size_cutoff + 1)}, dtype="int64") | ||
tm.assert_frame_equal(result, expected) | ||
|
||
def test_loc_setitem_empty_series(self): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!