-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
~Finish Collecting Arithmetic Tests #22350
Conversation
pandas/tests/arithmetic/conftest.py
Outdated
ids=lambda x: type(x).__name__) | ||
def idx(request): | ||
return request.param | ||
|
||
|
||
@pytest.fixture | ||
def tdser(): |
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.
Perhaps td_series
? At least an underscore between td
and ser
would be good.
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.
Good idea, will do.
Codecov Report
@@ Coverage Diff @@
## master #22350 +/- ##
=======================================
Coverage 92.04% 92.04%
=======================================
Files 169 169
Lines 50787 50787
=======================================
Hits 46745 46745
Misses 4042 4042
Continue to review full report at Codecov.
|
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.
comments on the fixture names. Also want to ensure that individual test files are completely obvious to what they are testing, so may want to add a level of nesting as things grow longer.
@pytest.fixture(params=[np.timedelta64(365, 'D'), | ||
pd.Timedelta(365).to_pytimedelta(), | ||
pd.Timedelta(days=365)] + _common_mismatch) | ||
def mismatched(request): |
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.
can you make this more descriptive
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.
docstring doesn't get the job done?
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.
no, prefer this to be a more descriptive name
@pytest.fixture(params=[pd.Timedelta(minutes=30).to_pytimedelta(), | ||
np.timedelta64(30, 's'), | ||
pd.Timedelta(seconds=30)] + _common_mismatch) | ||
def not_hourly(request): |
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.
I would add _fixture to these
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.
can you do this
@@ -712,6 +733,51 @@ def check(series, other): | |||
check(tser, 5) | |||
|
|||
|
|||
class TestUFuncCompat(object): |
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.
let's think about putting these in a separate file (test_funcs)? (may want to make numeric a subdir, its already getting long).
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.
I'll give that some thought. Preference is to do quick turnarounds with small PRs here since there are lots of bugs to fix.
can you rebase |
Rebased. After this the tests are pretty much all consolidated, so the next planned follow-up is to paramatrize/de-duplicate. Also since#22390 just went in, upcoming PR to fix most of the outstanding xfails |
@jbrockmendel : Have you addressed all of the comments here? I know you were waiting on @jreback to review this again, but at first glance, I can't tell if you have addressed everything he mentioned earlier. |
I think so, yes. But since this is a big enough PR that it is hard to keep track, I made #22559 as a subset of this in the hopes it would be easier in smaller pieces. |
@jbrockmendel : What about this one here? Just double checking! 🙂 So should we be reviewing / merging this? Or should we go after #22559 first? |
The suggestion on the fixture names was to stop fiddling for now and address in the next round. Since there were multiple comments about fixture names, its easy to lose track when one response is aimed at multiple comments.
Best case would be that everyone is happy here and #22559 is unnecessary. If this is going to be a slog, then I'd like to get #22559 in as this is a blocker for other work. |
ping @jreback - could you review this again? |
ids=lambda x: type(x).__name__) | ||
def idx(request): | ||
def numeric_index(request): |
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.
can you docstring
@pytest.fixture(params=[pd.Timedelta(minutes=30).to_pytimedelta(), | ||
np.timedelta64(30, 's'), | ||
pd.Timedelta(seconds=30)] + _common_mismatch) | ||
def not_hourly(request): |
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.
can you do this
@pytest.fixture(params=[np.timedelta64(365, 'D'), | ||
pd.Timedelta(365).to_pytimedelta(), | ||
pd.Timedelta(days=365)] + _common_mismatch) | ||
def mismatched(request): |
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.
no, prefer this to be a more descriptive name
ts = pd.Timestamp.now() | ||
df = pd.DataFrame({'x': range(5)}) | ||
with pytest.raises(TypeError): | ||
df > ts |
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.
commented in another PR these should be in test_datetime
can you rebsae |
Closing in favor of #22645. |
De-duplicate fixtures and put nearly all of them in conftest