Skip to content
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

CLN: tests for str.cat #22575

Merged
merged 2 commits into from
Sep 8, 2018
Merged

Conversation

h-vetinari
Copy link
Contributor

Cleaning up some left-overs from #20347 and preparing the tests for changing the default of join to 'left' in 1.0 (which would break some tests that assume no alignment currently). As a side benefit, this has:

  • nicer parametrization
  • nicer switches (and reduced usage of them within the tests)
  • now follows result / expected pattern instead of calculating result within assert_..._equal

@gfyoung gfyoung added Testing pandas testing functions or related to the test suite Clean labels Sep 2, 2018
@gfyoung
Copy link
Member

gfyoung commented Sep 2, 2018

@h-vetinari : Anaconda servers are experiencing some 503 issues. I'll restart tests later.

@datapythonista datapythonista added the Strings String extension data type and string data label Sep 2, 2018
@codecov
Copy link

codecov bot commented Sep 3, 2018

Codecov Report

Merging #22575 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22575   +/-   ##
=======================================
  Coverage   92.04%   92.04%           
=======================================
  Files         169      169           
  Lines       50782    50782           
=======================================
  Hits        46742    46742           
  Misses       4040     4040
Flag Coverage Δ
#multiple 90.45% <ø> (ø) ⬆️
#single 42.3% <ø> (ø) ⬆️

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 e2e1a10...2e1a3b6. Read the comment docs.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

pls don't use abbreviations, eg. always use expected

t = Index(['b', 'a', 'b', 'c'], dtype=dtype_target)

exp = Index(['ab', 'aa', 'bb', 'ac'])
if series_or_index == 'series':
exp = Series(exp)
exp = exp if box == Index else Series(exp, index=s)
Copy link
Contributor

Choose a reason for hiding this comment

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

use expected

@@ -469,12 +436,11 @@ def test_cat_on_filtered_index(self):

str_year = df.year.astype('str')
str_month = df.month.astype('str')
str_both = str_year.str.cat(str_month, sep=' ', join='left')
Copy link
Contributor

Choose a reason for hiding this comment

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

why are you removing the join here? is it not needed? should these be parameterized by join type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the course of #20347, the warnings were originally always issues whenever join was not specified - and this test correspondingly adapted. However, the warnings were later reduced to only be emitted in case of different indexes between caller and others, so in this case, it's not necessary.

@jreback jreback added this to the 0.24.0 milestone Sep 4, 2018
@pep8speaks
Copy link

pep8speaks commented Sep 4, 2018

Hello @h-vetinari! Thanks for updating the PR.

Comment last updated on September 04, 2018 at 23:02 Hours UTC

@h-vetinari
Copy link
Contributor Author

@jreback

pls don't use abbreviations, eg. always use expected

This module's full of exp (maybe even the majority), but I replaced it in the diff I'm working on now.

@h-vetinari
Copy link
Contributor Author

h-vetinari commented Sep 5, 2018

not sure what's up with these TestExcelWriter test failures...? rebasing didn't help.

Edit: saw that 22601 solved it. Rebased again.

@h-vetinari
Copy link
Contributor Author

@jreback All green

@jreback jreback merged commit d8daddc into pandas-dev:master Sep 8, 2018
@jreback
Copy link
Contributor

jreback commented Sep 8, 2018

thanks @h-vetinari

@h-vetinari h-vetinari deleted the tst_cln_str_cat branch September 9, 2018 21:23
aeltanawy pushed a commit to aeltanawy/pandas that referenced this pull request Sep 20, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Strings String extension data type and string data Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants