Skip to content

ENH/BUG: implement __iter__ for IntegerArray so conversions (to_dict, tolist, etc.) return python native types #37377

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
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
07782bc
TST: add tests from OP
arw2019 Oct 24, 2020
1b164c3
ENH: implement __iter__ from IntegerArray
arw2019 Oct 24, 2020
142c81f
feedback: move __iter__ method to base class
arw2019 Oct 24, 2020
3357901
TST: parametrize Int tests on dtype
arw2019 Oct 24, 2020
e38934e
TST: add floating tests
arw2019 Oct 24, 2020
fa2166d
Merge remote-tracking branch 'upstream/master' into GH29738
arw2019 Oct 24, 2020
c32aafa
TST: add boolean tests
arw2019 Oct 24, 2020
2eb7219
TST: #346654
arw2019 Oct 24, 2020
db4154d
feedback: gather tests in separate file + use fixtures
arw2019 Oct 30, 2020
30d2f09
TST: remove tests from original locations
arw2019 Oct 30, 2020
26314f7
Merge remote-tracking branch 'upstream/master' into GH29738
arw2019 Oct 30, 2020
8d81ec9
Merge remote-tracking branch 'upstream/master' into GH29738
arw2019 Nov 1, 2020
d7fced7
TST: rewrite expected construction using pd.array
arw2019 Nov 1, 2020
7bdc0ac
TST: add comment
arw2019 Nov 1, 2020
9bf6b25
TST: skip float-string conversion, reason:M f-p precision
arw2019 Nov 1, 2020
ec837c0
TST/BUG: correct test rewrite
arw2019 Nov 1, 2020
c7db14a
TST: skip string conversion test due to fp-precision issues
arw2019 Nov 1, 2020
e70a7df
TST: DRY the code using data fixture
arw2019 Nov 1, 2020
ff1ede7
CLN: remove unused code
arw2019 Nov 1, 2020
1df019c
TST/BUG: implement jorisvandenbossche suggestion to fix astype(str) t…
arw2019 Nov 3, 2020
2a5df3e
TST: skip boolean combine_add test
arw2019 Nov 3, 2020
79582d4
Merge remote-tracking branch 'upstream/master' into GH29738
arw2019 Nov 5, 2020
1206096
Merge branch 'master' of https://github.com/pandas-dev/pandas into GH…
arw2019 Nov 30, 2020
bcf0896
skip str astype tests for Float32Dtype
arw2019 Nov 30, 2020
cde954b
Merge branch 'master' of https://github.com/pandas-dev/pandas into GH…
arw2019 Dec 31, 2020
d9f4809
Merge branch 'master' of https://github.com/pandas-dev/pandas into GH…
arw2019 Jan 31, 2021
225a260
docstring fix
arw2019 Jan 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
skip str astype tests for Float32Dtype
  • Loading branch information
arw2019 committed Nov 30, 2020
commit bcf0896f21aa6fc71d14d69f7df27cae5ad47405
4 changes: 2 additions & 2 deletions pandas/tests/extension/base/casting.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def test_tolist(self, data):

def test_astype_str(self, data):
result = pd.Series(data[:5]).astype(str)
expected = pd.Series(data[:5], dtype=str)
expected = pd.Series([str(x) for x in data[:5]], dtype=str)
self.assert_series_equal(result, expected)

def test_astype_string(self, data):
# GH-33465
result = pd.Series(data[:5]).astype("string")
expected = pd.Series(data[:5], dtype="string")
expected = pd.Series([str(x) for x in data[:5]], dtype="string")
self.assert_series_equal(result, expected)

def test_to_numpy(self, data):
Expand Down
10 changes: 9 additions & 1 deletion pandas/tests/extension/test_floating.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,15 @@ def test_value_counts(self, all_data, dropna):


class TestCasting(base.BaseCastingTests):
pass
def test_astype_str(self, data):
if data.dtype == pd.Float32Dtype():
return
super().test_astype_str(data)

def test_astype_string(self, data):
if data.dtype == pd.Float32Dtype():
return
super().test_astype_string(data)


class TestGroupby(base.BaseGroupbyTests):
Expand Down