Commit 01e99de
authored
ENH: Allow storing ExtensionArrays in containers (#19520)
* ENH: non-interval changes
* COMPAT: py2 Super
* BUG: Use original object for extension array
* Consistent boxing / unboxing
NumPy compat
* 32-bit compat
* Add a test array
* linting
* Default __iter__
* Tests for value_counts
* Implement value_counts
* Py2 compat
* Fixed dropna
* Test fixups
* Started setitem
* REF/Clean: Internal / External values
* Move to index base
* Setitem tests, decimal example
* Compat
* Fixed extension block tests.
The only "API change" was that you can't just inherit from
NonConsolidatableMixin, which is OK since
1. it's a mixin
2. geopandas also inherits from Block
* Clarify binop tests
Make it clearer which bit might raise
* TST: Removed ops tests
* Cleanup unique handling
* Simplify object concat
* Use values for intersection
I think eventually we'll want to ndarray_values for this, but it'll
require a bit more work to support. Currently, using ndarary_values
causes occasional failures on categorical.
* hmm
* More failing tests
* remove bad test
* better setitem
* Dropna works.
* Restore xfail test
* Test Categorical
* Xfail setitem tests
* TST: Skip JSON tests on py2
* Additional testing
* More tests
* ndarray_values
* API: Default ExtensionArray.astype
(cherry picked from commit 943a915562b72bed147c857de927afa0daf31c1a)
(cherry picked from commit fbf0a06)
* Simplify concat_as_object
* Py2 compat
(cherry picked from commit b20e12c)
* Set-ops ugliness
* better docstrings
* tolist
* linting
* Moved dtypes
(cherry picked from commit d136227)
* clean
* cleanup
* NumPy compat
* Use base _values for CategoricalIndex
* Update dev docs
* cleanup
* cleanup
(cherry picked from commit 2425621)
* cleanup
* Linting
* Precision in tests
* Linting
* Move to extension
* Push _ndarray_values to ExtensionArray
Now IndexOpsMixin._ndarray_values will dispatch all the way down to the EA.
Subclasses like Categorical can override it as they see fit.
* Clean up tolist
* Move test locations
* Fixed test
* REF: Update per comments
* lint
* REF: Use _values for size and shape
* PERF: Implement size, shape for IntervalIndex
* PERF: Avoid materializing values for PeriodIndex shape, size
* Cleanup
* Override nbytes
* Remove unused change
* Docs
* Test cleanpu
* Always set PANDAS_TESTING_MODE
* Revert "Always set PANDAS_TESTING_MODE"
This reverts commit a312ba5.
* Explicitly catch warnings or not
* fastparquet warnings
* Unicode literals strikes again.
Only catch fp warning for newer numpy
* Restore circle env var
* More parquet test catching
* No stacklevel
* Lower bound on FP
* Exact bound for FP
* Don't use fastpath for ExtensionBlock make_block
* Consistently use _values
* TST: Additional constructor tests
* CLN: de-nested a bit
* _fill_value handling
* Handle user provided dtype in constructors.
When the dtype matches, we allow it to proceed.
When the dtype would require coercion, we raise.
* Document ExtensionBlock._maybe_coerce_values
Also changes to use _values as we should
* Created ABCExtensionArray
* TST: Tests for is_object_dtype and is_string_dtype and EAs
* fixup! Handle user provided dtype in constructors.
* Doc for setitem
* Split base tests
* Revert test_parquet changes
* API: Removed _fill_value from the interface
* Push coercion to extension dtype till later
* Linting
* ERR: Better error message for coercion to 3rd party dtypes
* CLN: Make take_nd EA aware
* Revert sparse changes
* Other _typ for ABCExtensionArray
* Test cleanup and expansion.
Tests for concating and aligning frames
* Copy if copy
* TST: remove self param for fixture
* Remove unnescessary EA handling in Series ctor
* API: Removed value_counts
Moved setitem notes to comment
* More doc notes
* Handle expanding a DataFrame with an EA
* Added ExtensionDtype.__eq__
Support for astype
* linting
* REF: is_dtype_equal refactor
Moved from PandasExtensionDtype to ExtensionDtype with one modification:
catch TypeError explicitly.
* Remove reference to dtype being a class
* move
* Moved sparse check to take_nd
* Docstring
* Split tests
* Revert index change
* Copy changes
* Simplify EA implementation names
comments for object vs. str missing values
* Linting1 parent 0176f6e commit 01e99de
File tree
32 files changed
+1276
-130
lines changed- pandas
- core
- arrays
- dtypes
- indexes
- tests
- categorical
- extension
- base
- category
- decimal
- json
32 files changed
+1276
-130
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
547 | 548 | | |
548 | 549 | | |
549 | 550 | | |
550 | | - | |
| 551 | + | |
551 | 552 | | |
552 | 553 | | |
553 | 554 | | |
| |||
1292 | 1293 | | |
1293 | 1294 | | |
1294 | 1295 | | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
1295 | 1299 | | |
1296 | 1300 | | |
1297 | | - | |
1298 | | - | |
| 1301 | + | |
| 1302 | + | |
1299 | 1303 | | |
1300 | 1304 | | |
1301 | 1305 | | |
| |||
1315 | 1319 | | |
1316 | 1320 | | |
1317 | 1321 | | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
1318 | 1327 | | |
1319 | 1328 | | |
| 1329 | + | |
1320 | 1330 | | |
1321 | | - | |
1322 | | - | |
1323 | | - | |
| 1331 | + | |
| 1332 | + | |
1324 | 1333 | | |
1325 | 1334 | | |
1326 | 1335 | | |
1327 | 1336 | | |
1328 | 1337 | | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
1329 | 1341 | | |
1330 | 1342 | | |
1331 | 1343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | 33 | | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
96 | 135 | | |
97 | 136 | | |
98 | 137 | | |
| |||
107 | 146 | | |
108 | 147 | | |
109 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
110 | 159 | | |
111 | 160 | | |
112 | 161 | | |
| |||
132 | 181 | | |
133 | 182 | | |
134 | 183 | | |
135 | | - | |
136 | | - | |
137 | 184 | | |
| 185 | + | |
| 186 | + | |
138 | 187 | | |
139 | 188 | | |
140 | 189 | | |
| |||
184 | 233 | | |
185 | 234 | | |
186 | 235 | | |
187 | | - | |
188 | | - | |
| 236 | + | |
| 237 | + | |
189 | 238 | | |
190 | 239 | | |
191 | 240 | | |
| |||
198 | 247 | | |
199 | 248 | | |
200 | 249 | | |
201 | | - | |
202 | | - | |
203 | | - | |
| 250 | + | |
| 251 | + | |
204 | 252 | | |
205 | 253 | | |
206 | 254 | | |
207 | 255 | | |
208 | 256 | | |
209 | 257 | | |
210 | | - | |
| 258 | + | |
211 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
212 | 264 | | |
213 | 265 | | |
214 | 266 | | |
| |||
230 | 282 | | |
231 | 283 | | |
232 | 284 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | 285 | | |
239 | 286 | | |
240 | 287 | | |
241 | 288 | | |
242 | 289 | | |
243 | | - | |
| 290 | + | |
244 | 291 | | |
245 | 292 | | |
246 | 293 | | |
| |||
257 | 304 | | |
258 | 305 | | |
259 | 306 | | |
| 307 | + | |
260 | 308 | | |
261 | 309 | | |
262 | 310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
| |||
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
26 | 55 | | |
27 | 56 | | |
28 | 57 | | |
| |||
102 | 131 | | |
103 | 132 | | |
104 | 133 | | |
105 | | - | |
| 134 | + | |
106 | 135 | | |
107 | 136 | | |
108 | 137 | | |
109 | | - | |
| 138 | + | |
| 139 | + | |
110 | 140 | | |
111 | 141 | | |
112 | 142 | | |
| |||
118 | 148 | | |
119 | 149 | | |
120 | 150 | | |
121 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
122 | 154 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1708 | 1708 | | |
1709 | 1709 | | |
1710 | 1710 | | |
1711 | | - | |
1712 | 1711 | | |
1713 | 1712 | | |
| 1713 | + | |
1714 | 1714 | | |
1715 | 1715 | | |
1716 | 1716 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 69 | | |
77 | 70 | | |
78 | 71 | | |
| |||
82 | 75 | | |
83 | 76 | | |
84 | 77 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 78 | | |
104 | 79 | | |
105 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
0 commit comments