Commit 209097d
committed
fix: handle lazy AnnData obs conversion in query operations
When lazy AnnData objects (from anndata.experimental.read_lazy) are
subset, their obs attribute is a Dataset2D object, not a pandas
DataFrame. Using pd.DataFrame(table.obs) produces a malformed DataFrame.
This fix uses table.obs.to_memory() for lazy tables to properly convert
Dataset2D to DataFrame while preserving all column data.
Files modified:
- relational_query.py: _filter_table_by_element_names,
_filter_table_by_elements, get_values
- _utils.py: _inplace_fix_subset_categorical_obs1 parent 120d11d commit 209097d
2 files changed
Lines changed: 34 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
196 | 202 | | |
197 | 203 | | |
198 | 204 | | |
199 | | - | |
| 205 | + | |
200 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
201 | 213 | | |
202 | 214 | | |
203 | 215 | | |
| |||
1066 | 1078 | | |
1067 | 1079 | | |
1068 | 1080 | | |
1069 | | - | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
1070 | 1087 | | |
1071 | 1088 | | |
1072 | 1089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
214 | 226 | | |
215 | 227 | | |
216 | 228 | | |
217 | | - | |
| 229 | + | |
218 | 230 | | |
219 | 231 | | |
220 | 232 | | |
| |||
0 commit comments