Ray's Knowledge Base
Unlock

A descriptor that re-reads through a new entry point must reproduce the old path's normalisation and row order

PitfallVerified 25 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

Moving a query into a Question descriptor makes it return a different answer than the method it replaced: access_pattern came back 648537/3935 through ask() against 648538/3934 from the old per-window method.

Cause#

Two gaps, both silent. (1) The old path ran every frame through _prepare, which fills missing columns and casts pid/tid/ts/dur, so a select-only frame has different dtypes and no null-filled args. (2) The old window read per file, so a lag window ordered by ts alone broke ties in file order; ask concatenates first, so equal timestamps across files can reorder and one row flips category.

Fix#

In ask(), apply self._prepare(frame, qn.columns) before qn.shape(...), and treat order_by=[ts] as non-total: a question that windows over time must order by a key that is unique, or window per file. Deleting the old method is the only way to make the two agree for good; a shape that is the single implementation cannot drift.

Evidence#

python/dftracer/dashboard/trace/questions/ops.py access_pattern; ask() in trace/data.py; measured on /tmp/watchtree/20260930_234947 (1,437,066 rows) with index /tmp/ap-idx2: direct {648538,3934} vs ask {648537,3935}, mode seek, seeks 22370 in both.