Skip to content

Cleanup Series arithmetic tests #18974

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

Closed

Conversation

jbrockmendel
Copy link
Member

Also a few for TimedeltaIndex. One of the TimedeltaIndex tests specifically tests a behavior I think is wrong, #18963. Actually fixing that bug is separate.

Actual content of tests is unchanged.

@jbrockmendel
Copy link
Member Author

Travis error in TestTSPlot.test_time looks unrelated.

@jreback jreback added Numeric Operations Arithmetic, Comparison, and Logical operations Testing pandas testing functions or related to the test suite labels Dec 29, 2017
expected = TimedeltaIndex(np.arange(5, dtype='int64') ** 2)
tm.assert_index_equal(result, expected)

# FIXME: These ops should return Series, NOT indexes
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO

data = [[1, 2, 3],
[1.1, 2.2, 3.3],
[pd.Timestamp('2011-01-01'), pd.Timestamp('2011-01-02'),
pd.NaT],
Copy link
Contributor

Choose a reason for hiding this comment

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

paramaterize


def test_invalid_add_sub(self):
# invalid ops
obj_series = tm.makeObjectSeries()
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a comment

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. Now that I actually look at tm.makeObjectSeries() I'm surprised that it gives a Series[datetime64] with what looks like random strings for its Index. I'll move this down into TestDatetimeSeriesArithmetic

Copy link
Member Author

Choose a reason for hiding this comment

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

Incidentally, this is one of the cases that DatetimeIndex.__add__/__sub__ messes up.

@codecov
Copy link

codecov bot commented Dec 29, 2017

Codecov Report

Merging #18974 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18974      +/-   ##
==========================================
+ Coverage   91.58%   91.58%   +<.01%     
==========================================
  Files         150      150              
  Lines       48967    48939      -28     
==========================================
- Hits        44846    44823      -23     
+ Misses       4121     4116       -5
Flag Coverage Δ
#multiple 89.95% <ø> (ø) ⬆️
#single 41.74% <ø> (+0.01%) ⬆️
Impacted Files Coverage Δ
pandas/core/ops.py 90.2% <0%> (-0.04%) ⬇️
pandas/core/indexes/base.py 96.45% <0%> (-0.01%) ⬇️
pandas/core/common.py 92.92% <0%> (ø) ⬆️
pandas/core/indexes/datetimes.py 95.57% <0%> (+0.12%) ⬆️
pandas/core/indexes/datetimelike.py 97.19% <0%> (+0.15%) ⬆️
pandas/util/testing.py 84.9% <0%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4883a43...65b120d. Read the comment docs.

@jbrockmendel
Copy link
Member Author

Test error still looks unrelated and this is bound to cause merge headaches for other higher-priority PRs. Closing for now, will circle back eventually.

@jbrockmendel jbrockmendel deleted the cleanup_series_tests branch February 11, 2018 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Numeric Operations Arithmetic, Comparison, and Logical operations Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants