Ray's Knowledge Base
Unlock

Gather string and list ranges with take when slice supports only fixed-width data

PitfallVerified 30 Sep 2026Holds project: dftracer-utils
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

Slicing string or list data returns a null Series on the affected native path. A spilled join crashed on a text column when a partition had no right rows.

Cause#

Series::slice returns a null handle for variable-width columns (strings, lists) by contract. The slice() path used during native spill work supported only fixed-width columns. GraceJoin built its right-side template with slice(0, 0), so a partition with no right rows gave a null template for a text column.

Fix#

Gather the desired range with take() instead. For an empty template, take an empty index vector: c.take({}). Check the column types before relying on the fixed-width slice path.

Evidence#

Inbox fd3899dec5 reports this limitation and use of range-based take() for spill list children. The note names DataFrame slice but gives no exact overload or source location; confirm the current API before applying the workaround elsewhere.

Inbox 15b408df08 (2026-09-30): "Series::slice returns a null handle for variable-width columns (strings, lists) by contract; take an empty index vector (c.take({})) for an empty template. GraceJoin's right template used slice(0,0) and crashed on a text column when a partition had no right rows." A regression test in test_join_spill.cpp failed before the fix and passed after it.

Also found by searching

  • Series::slice returns null for string column, spilled join crashes on text
  • slicing a list or string column gives a null series in native code
  • how do I get an empty template or row range of a variable-width column
  • slice(0,0) null handle variable width, use take({}) instead
  • Series::slice returns null handle for string column, crash on empty partition in spilled join
  • slice(0, 0) of a text column gives null Series in GraceJoin
  • how do I take a range of a string or list column when slice only supports fixed width types?
  • c.take({}) empty template for variable-width column null pointer crash in native spill