Skip to content

remove unused cimport, parametrize test #21710

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
merged 2 commits into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion pandas/_libs/internals.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -435,4 +435,4 @@ def get_blkno_indexers(int64_t[:] blknos, bint group=True):
res_view[i] = diff
i += 1

yield blkno, result
yield blkno, result
2 changes: 0 additions & 2 deletions pandas/_libs/writers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ cimport numpy as cnp
from numpy cimport ndarray, uint8_t
cnp.import_array()

cimport util
Copy link
Contributor

Choose a reason for hiding this comment

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

do you have a linter that catches this?

Copy link
Member Author

Choose a reason for hiding this comment

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

We've discussed this a couple times and haven't found a good solution for this. It's on my list to bring up with the group at the sprint.

Copy link
Contributor

Choose a reason for hiding this comment

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

right, just asking if you found a soln!



ctypedef fused pandas_string:
str
Expand Down
22 changes: 5 additions & 17 deletions pandas/tests/sparse/test_libsparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,22 +596,10 @@ def _check_case(xloc, xlen, yloc, ylen, eloc, elen):

check_cases(_check_case)


# too cute? oh but how I abhor code duplication
check_ops = ['add', 'sub', 'mul', 'truediv', 'floordiv']


def make_optestf(op):
def f(self):
sparse_op = getattr(splib, 'sparse_%s_float64' % op)
python_op = getattr(operator, op)
@pytest.mark.parametrize('opname',
Copy link
Contributor

Choose a reason for hiding this comment

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

worth making a fixture in conftest?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is a pretty specific set of strings that wouldn't get used often. But I didn't look at this closely, just saw that the existing formatting was crying out to be updated.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, that's fine

['add', 'sub', 'mul', 'truediv', 'floordiv'])
def test_op(self, opname):
sparse_op = getattr(splib, 'sparse_%s_float64' % opname)
python_op = getattr(operator, opname)
self._op_tests(sparse_op, python_op)

f.__name__ = 'test_%s' % op
return f


for op in check_ops:
g = make_optestf(op)
setattr(TestSparseOperators, g.__name__, g)
del g