Commit 193086f
committed
Fix datashader outline column-attach using positional assignment (#681)
`transformed_element.assign(col=series)` aligns by index. When the
post-inner-join element carries a non-contiguous index (e.g.
[0, 2, 5, ...]) but the outline source vector is built with a default
RangeIndex(0..n-1), rows whose indices don't intersect get NaN. Those
NaNs are then lifted to the `ds_nan` sentinel by `_inject_ds_nan_sentinel`,
and one polygon ends up rendered as `na_color` instead of its real
category — visible as a gray outline among otherwise correctly-colored
polygons on the Linux CI runners.
The matplotlib path is unaffected because it goes through
`_color_vector_to_rgba`, which operates positionally.
Fix: assign positionally via `df[col] = pd.Categorical(...)` (which uses
position-based assignment for ExtensionArray-typed RHS), on an explicit
copy so the caller's dataframe is not mutated.1 parent 947b8f8 commit 193086f
1 file changed
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
437 | | - | |
438 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
439 | 443 | | |
440 | | - | |
441 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
442 | 449 | | |
443 | | - | |
444 | | - | |
| 450 | + | |
445 | 451 | | |
446 | 452 | | |
447 | 453 | | |
| |||
0 commit comments