Commit 367fc26
authored
SNOW-1524760: Fix Series.isin behavior (#3973)
This PR fixes the behavior of `Series.isin(other_series)`, which ignores indices instead of joining on row/column labels. It also adds a fast path for `Series.isin(dataframe)`, which should always return false at every index.
Per @sfc-gh-mvashishtha's investigation in the linked ticket:
> It seems that pandas behavior is:
> - ignore row and column labels for Series.isin(series)
> - Series.isin(dataframe) always returns False, e.g. s = pandas.Series([1]); s.isin(s.to_frame())
> - DataFrame.isin(dataframe) joins on both row and column labels
> - DataFrame.isin(series) ignores column labels but not row labels, e.g. pandas.DataFrame({'A': [1, 2]}).isin(pandas.Series([1, 2], name='B', index=[0,1])) gives True values because even though the column name is different, the index matches, but pandas.DataFrame({'A': [1, 2]}).isin(pandas.Series([1, 2], name='B', index=[-1, -2])) gives False values.1 parent 8a555ef commit 367fc26
File tree
7 files changed
+116
-17
lines changed- src/snowflake/snowpark/modin/plugin
- _internal
- compiler
- extensions
- tests/integ/modin
- series
7 files changed
+116
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
Lines changed: 48 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
| |||
120 | 127 | | |
121 | 128 | | |
122 | 129 | | |
| 130 | + | |
123 | 131 | | |
124 | 132 | | |
125 | 133 | | |
| |||
135 | 143 | | |
136 | 144 | | |
137 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
138 | 176 | | |
139 | 177 | | |
140 | 178 | | |
| |||
178 | 216 | | |
179 | 217 | | |
180 | 218 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | 219 | | |
187 | 220 | | |
188 | 221 | | |
189 | 222 | | |
190 | 223 | | |
191 | 224 | | |
192 | 225 | | |
| 226 | + | |
193 | 227 | | |
194 | 228 | | |
195 | 229 | | |
| |||
205 | 239 | | |
206 | 240 | | |
207 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
208 | 250 | | |
209 | 251 | | |
210 | 252 | | |
| |||
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14507 | 14507 | | |
14508 | 14508 | | |
14509 | 14509 | | |
| 14510 | + | |
14510 | 14511 | | |
14511 | 14512 | | |
14512 | 14513 | | |
| |||
14521 | 14522 | | |
14522 | 14523 | | |
14523 | 14524 | | |
14524 | | - | |
| 14525 | + | |
| 14526 | + | |
14525 | 14527 | | |
14526 | 14528 | | |
14527 | | - | |
| 14529 | + | |
14528 | 14530 | | |
14529 | 14531 | | |
14530 | 14532 | | |
14531 | 14533 | | |
14532 | 14534 | | |
14533 | 14535 | | |
14534 | 14536 | | |
| 14537 | + | |
14535 | 14538 | | |
14536 | 14539 | | |
14537 | 14540 | | |
| 14541 | + | |
14538 | 14542 | | |
14539 | 14543 | | |
14540 | 14544 | | |
14541 | 14545 | | |
14542 | 14546 | | |
14543 | 14547 | | |
| 14548 | + | |
14544 | 14549 | | |
14545 | 14550 | | |
14546 | 14551 | | |
14547 | 14552 | | |
14548 | 14553 | | |
14549 | 14554 | | |
14550 | 14555 | | |
14551 | | - | |
| 14556 | + | |
14552 | 14557 | | |
14553 | 14558 | | |
14554 | 14559 | | |
| |||
14621 | 14626 | | |
14622 | 14627 | | |
14623 | 14628 | | |
14624 | | - | |
| 14629 | + | |
14625 | 14630 | | |
14626 | | - | |
| 14631 | + | |
| 14632 | + | |
| 14633 | + | |
| 14634 | + | |
14627 | 14635 | | |
14628 | 14636 | | |
14629 | 14637 | | |
14630 | | - | |
| 14638 | + | |
| 14639 | + | |
| 14640 | + | |
| 14641 | + | |
14631 | 14642 | | |
14632 | 14643 | | |
14633 | 14644 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
1040 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1041 | 1043 | | |
1042 | 1044 | | |
1043 | 1045 | | |
| |||
1056 | 1058 | | |
1057 | 1059 | | |
1058 | 1060 | | |
1059 | | - | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
1060 | 1066 | | |
1061 | 1067 | | |
1062 | 1068 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
797 | | - | |
| 797 | + | |
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
688 | 688 | | |
689 | 689 | | |
690 | 690 | | |
691 | | - | |
| 691 | + | |
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
| |||
0 commit comments