-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Remove unused test code #25670
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
jreback
merged 4 commits into
pandas-dev:master
from
simonjayhawkins:test_complex_cmp_ops
Mar 12, 2019
Merged
CLN: Remove unused test code #25670
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3c64662
CLN: Remove unused test code
simonjayhawkins e116692
Merge remote-tracking branch 'upstream/master' into test_complex_cmp_ops
simonjayhawkins 37f3bbd
remove unused _series_frame_incompatible
simonjayhawkins d15f6bb
part parametrize
simonjayhawkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,6 @@ | |
assert_series_equal, makeCustomDataframe as mkdf, randbool) | ||
|
||
_series_frame_incompatible = _bool_ops_syms | ||
_scalar_skip = 'in', 'not in' | ||
|
||
|
||
@pytest.fixture(params=( | ||
|
@@ -168,7 +167,15 @@ def test_complex_cmp_ops(self): | |
for lhs, cmp1, rhs, binop, cmp2 in product(self.lhses, cmp_ops, | ||
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. Does it make sense to parametrize this? |
||
self.rhses, self.bin_ops, | ||
cmp2_ops): | ||
self.check_complex_cmp_op(lhs, cmp1, rhs, binop, cmp2) | ||
lhs_new = _eval_single_bin(lhs, cmp1, rhs, self.engine) | ||
rhs_new = _eval_single_bin(lhs, cmp2, rhs, self.engine) | ||
expected = _eval_single_bin( | ||
lhs_new, binop, rhs_new, self.engine) | ||
|
||
ex = '(lhs {cmp1} rhs) {binop} (lhs {cmp2} rhs)'.format( | ||
cmp1=cmp1, binop=binop, cmp2=cmp2) | ||
result = pd.eval(ex, engine=self.engine, parser=self.parser) | ||
self.check_equal(result, expected) | ||
|
||
def test_simple_cmp_ops(self): | ||
bool_lhses = (DataFrame(randbool(size=(10, 5))), | ||
|
@@ -225,41 +232,6 @@ def check_equal(self, result, expected): | |
else: | ||
assert result == expected | ||
|
||
def check_complex_cmp_op(self, lhs, cmp1, rhs, binop, cmp2): | ||
skip_these = _scalar_skip | ||
ex = '(lhs {cmp1} rhs) {binop} (lhs {cmp2} rhs)'.format(cmp1=cmp1, | ||
binop=binop, | ||
cmp2=cmp2) | ||
scalar_with_in_notin = (is_scalar(rhs) and (cmp1 in skip_these or | ||
cmp2 in skip_these)) | ||
if scalar_with_in_notin: | ||
with pytest.raises(TypeError): | ||
pd.eval(ex, engine=self.engine, parser=self.parser) | ||
with pytest.raises(TypeError): | ||
pd.eval(ex, engine=self.engine, parser=self.parser, | ||
local_dict={'lhs': lhs, 'rhs': rhs}) | ||
else: | ||
lhs_new = _eval_single_bin(lhs, cmp1, rhs, self.engine) | ||
rhs_new = _eval_single_bin(lhs, cmp2, rhs, self.engine) | ||
if (isinstance(lhs_new, Series) and | ||
isinstance(rhs_new, DataFrame) and | ||
binop in _series_frame_incompatible): | ||
pass | ||
# TODO: the code below should be added back when left and right | ||
# hand side bool ops are fixed. | ||
# | ||
# try: | ||
# pytest.raises(Exception, pd.eval, ex, | ||
# local_dict={'lhs': lhs, 'rhs': rhs}, | ||
# engine=self.engine, parser=self.parser) | ||
# except AssertionError: | ||
# raise | ||
else: | ||
expected = _eval_single_bin( | ||
lhs_new, binop, rhs_new, self.engine) | ||
result = pd.eval(ex, engine=self.engine, parser=self.parser) | ||
self.check_equal(result, expected) | ||
|
||
def check_chained_cmp_op(self, lhs, cmp1, mid, cmp2, rhs): | ||
|
||
def check_operands(left, right, cmp_op): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
_series_frame_incompatible
can also be removed. AFK for a short while. will remove.