Commit 0e2277b
DEPR: deprecate returning a tuple from a callable in iloc indexing (#53769)
* DEPR: deprecate returning a tuple from a callable in iloc indexing
The current semantics are that tuple-destructuring of the key is
performed before unwinding any callables. As such, if a callable
returns a tuple for iloc, it will be handled incorrectly. To avoid
this, explicitly deprecate support for this behaviour.
Closes #53533.
* Update documentation and add test
* Refactor check into method
* Link to docs in whatsnew entry
* Move deprecation warning so docstring checks don't complain
* Prelim changes
* Update pandas/core/indexing.py
* Adjust test
---------
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>1 parent b8fc8cd commit 0e2277b
File tree
3 files changed
+51
-2
lines changed- doc/source/user_guide
- pandas
- core
- tests/frame/indexing
3 files changed
+51
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
| |||
450 | 460 | | |
451 | 461 | | |
452 | 462 | | |
| 463 | + | |
| 464 | + | |
453 | 465 | | |
454 | 466 | | |
455 | 467 | | |
| |||
553 | 565 | | |
554 | 566 | | |
555 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
556 | 574 | | |
557 | 575 | | |
558 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| |||
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
156 | 164 | | |
157 | 165 | | |
158 | 166 | | |
| |||
166 | 174 | | |
167 | 175 | | |
168 | 176 | | |
169 | | - | |
| 177 | + | |
| 178 | + | |
170 | 179 | | |
171 | 180 | | |
172 | 181 | | |
| |||
878 | 887 | | |
879 | 888 | | |
880 | 889 | | |
881 | | - | |
| 890 | + | |
| 891 | + | |
882 | 892 | | |
883 | 893 | | |
884 | 894 | | |
| |||
1137 | 1147 | | |
1138 | 1148 | | |
1139 | 1149 | | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
1140 | 1161 | | |
1141 | 1162 | | |
1142 | 1163 | | |
| |||
1151 | 1172 | | |
1152 | 1173 | | |
1153 | 1174 | | |
| 1175 | + | |
1154 | 1176 | | |
1155 | 1177 | | |
1156 | 1178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1020 | 1029 | | |
1021 | 1030 | | |
1022 | 1031 | | |
| |||
0 commit comments