Skip to content

Conversation

@priyankjain
Copy link
Contributor

@priyankjain priyankjain commented Jun 16, 2016

.str.replace now raises TypeError when replacement is invalid

@codecov-io
Copy link

codecov-io commented Jun 16, 2016

Current coverage is 84.28%

Merging #13460 into master will increase coverage by <.01%

@@ master #13460 diff @@ ========================================== Files 138 138 Lines 50937 50939 +2 Methods 0 0 Messages 0 0 Branches 0 0 ========================================== + Hits 42934 42936 +2  Misses 8003 8003 Partials 0 0 

Powered by Codecov. Last updated by d814f43...d5c3f1b

Copy link
Member

Choose a reason for hiding this comment

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

Pls describe the kind of error, like "does not raise ValueError".

@sinhrks sinhrks added Error Reporting Incorrect or improved errors from pandas Strings String extension data type and string data labels Jun 16, 2016
@sinhrks sinhrks added this to the 0.18.2 milestone Jun 16, 2016
@priyankjain priyankjain force-pushed the 13438 branch 3 times, most recently from 0e398b6 to f4f04e3 Compare June 16, 2016 10:41
Copy link
Member

Choose a reason for hiding this comment

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

Can you put this in the beginning? I (so switch the if/else part, also in that case the else is not needed)
IMO that is an easier to follow logic.

Copy link
Member

Choose a reason for hiding this comment

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

Further, I don't find the error message clear. I know this is the one from the stdlib, but a numeric value can be converted to string, so that sounds a bit strange. Maybe just something like "expected a string" or "the replacement argument should be a string"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do said changes, do you know why travis test has not started, it's yellow for around half an hour, no progress.

Copy link
Member

@jorisvandenbossche jorisvandenbossche Jun 16, 2016

Choose a reason for hiding this comment

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

That is because there is a queue, and each time you push a new version (or somebody else pushes on his/her PR), one travis build is added to this queue: https://travis-ci.org/pydata/pandas/pull_requests
(but will stop some of your builds)

@priyankjain priyankjain force-pushed the 13438 branch 2 times, most recently from 781b959 to 4079333 Compare June 16, 2016 11:34
Copy link
Member

Choose a reason for hiding this comment

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

how about "repl must be a string", to be consistent with docstring.

.str.replace now raises TypeError when replacement string is not string like
@jreback
Copy link
Contributor

jreback commented Jun 16, 2016

thanks @priyankjain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Error Reporting Incorrect or improved errors from pandas Strings String extension data type and string data

5 participants