-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: raise for invalid dtypes per issue #15520 #16047
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
Changes from all commits
99fb660
fecba12
c10e1d4
3700259
ee0030f
d4971cd
f858726
3eaa432
a358181
ad9f345
fbed5a6
c3699fb
b3c2fbb
73d980a
3646eb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1208,10 +1208,9 @@ def test_extractall_same_as_extract_subject_index(self): | |
tm.assert_frame_equal(extract_one_noname, no_match_index) | ||
|
||
def test_empty_str_methods(self): | ||
empty_str = empty = Series(dtype=str) | ||
empty_str = empty = Series(dtype=object) | ||
empty_int = Series(dtype=int) | ||
empty_bool = Series(dtype=bool) | ||
empty_list = Series(dtype=list) | ||
empty_bytes = Series(dtype=object) | ||
|
||
# GH7241 | ||
|
@@ -1242,25 +1241,24 @@ def test_empty_str_methods(self): | |
DataFrame(columns=[0, 1], dtype=str), | ||
empty.str.extract('()()', expand=False)) | ||
tm.assert_frame_equal(DataFrame(dtype=str), empty.str.get_dummies()) | ||
tm.assert_series_equal(empty_str, empty_list.str.join('')) | ||
tm.assert_series_equal(empty_str, empty_str.str.join('')) | ||
tm.assert_series_equal(empty_int, empty.str.len()) | ||
tm.assert_series_equal(empty_list, empty_list.str.findall('a')) | ||
tm.assert_series_equal(empty_str, empty_str.str.findall('a')) | ||
tm.assert_series_equal(empty_int, empty.str.find('a')) | ||
tm.assert_series_equal(empty_int, empty.str.rfind('a')) | ||
tm.assert_series_equal(empty_str, empty.str.pad(42)) | ||
tm.assert_series_equal(empty_str, empty.str.center(42)) | ||
tm.assert_series_equal(empty_list, empty.str.split('a')) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add back tests with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added back the tests after looking out for duplicates; all green now. |
||
tm.assert_series_equal(empty_list, empty.str.rsplit('a')) | ||
tm.assert_series_equal(empty_list, | ||
tm.assert_series_equal(empty_str, empty.str.split('a')) | ||
tm.assert_series_equal(empty_str, empty.str.rsplit('a')) | ||
tm.assert_series_equal(empty_str, | ||
empty.str.partition('a', expand=False)) | ||
tm.assert_series_equal(empty_list, | ||
tm.assert_series_equal(empty_str, | ||
empty.str.rpartition('a', expand=False)) | ||
tm.assert_series_equal(empty_str, empty.str.slice(stop=1)) | ||
tm.assert_series_equal(empty_str, empty.str.slice(step=1)) | ||
tm.assert_series_equal(empty_str, empty.str.strip()) | ||
tm.assert_series_equal(empty_str, empty.str.lstrip()) | ||
tm.assert_series_equal(empty_str, empty.str.rstrip()) | ||
tm.assert_series_equal(empty_str, empty.str.rstrip()) | ||
tm.assert_series_equal(empty_str, empty.str.wrap(42)) | ||
tm.assert_series_equal(empty_str, empty.str.get(0)) | ||
tm.assert_series_equal(empty_str, empty_bytes.str.decode('ascii')) | ||
|
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.
use a list for checking these cases
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.
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.
if you want to convert to using more pytest style would be graet as well (could be a followup as well), e.g.: http://pandas-docs.github.io/pandas-docs-travis/contributing.html#transitioning-to-pytest