fix: preserve heterogeneous Ray Data rows across batch ingestion - #2474
Merged
Conversation
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Rebuild page-granularity rows instead of mutating Arrow-backed frames, and point the leftover pipeline content module at the same transforms so text_image bbox evaluation and LanceDB vector-dim inference stay on one path.
Signed-off-by: jioffe502 <jioffe@nvidia.com>
Signed-off-by: jioffe502 <jioffe@nvidia.com>
Signed-off-by: jioffe502 <jioffe@nvidia.com>
Contributor
Greptile SummaryThe PR preserves heterogeneous pandas rows across Ray Data ingestion boundaries and normalizes bbox and embedding containers before downstream processing.
|
| Filename | Overview |
|---|---|
| nemo_retriever/src/nemo_retriever/common/modality/content_transforms.py | Rebuilds transformed rows and normalizes bbox containers to preserve heterogeneous pandas-compatible values. |
| nemo_retriever/src/nemo_retriever/common/vdb/records.py | Normalizes array-like embeddings into Python lists before constructing VDB records. |
| nemo_retriever/src/nemo_retriever/graph/executor.py | Detects pandas-preserving operators and maintains stable pandas blocks through downstream Ray stages. |
| nemo_retriever/src/nemo_retriever/graph/ingestor_runtime.py | Marks content reshape UDFs as requiring preserved pandas output. |
| nemo_retriever/src/nemo_retriever/operators/extract/txt/ray_data.py | Annotates the text chunk actor capability flag and opts chunk expansion into stable pandas handling. |
| nemo_retriever/tests/test_executor_arrow_pandas.py | Adds regression coverage for Arrow conversion, pandas preservation, tensor promotion, and content reshaping. |
| nemo_retriever/tests/test_pipeline_graph.py | Verifies ingestion graph stages opt into pandas-preserving execution. |
| nemo_retriever/tests/test_vdb_records.py | Covers conversion of array-like embedding values at the VDB record boundary. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Extracted Ray Data rows] --> B{Reshaping stage}
B -->|Explode content| C[Heterogeneous pandas rows]
B -->|Collapse pages| C
B -->|Text chunking| C
C --> D[Stable pandas blocks]
D --> E[Embedding operator]
E --> F[Normalize vectors to lists]
F --> G[LanceDB ingestion]
Reviews (2): Last reviewed commit: "Update nemo_retriever/src/nemo_retriever..." | Re-trigger Greptile
edknv
approved these changes
Aug 13, 2026
…ta.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PR #2474 is the canonical Arrow-boundary fix for the reported page embedding, text chunking, bbox, and LanceDB vector issues. The StoreOperator issue remains out of scope.
The fix has three layers:
171918de: preserve pandas output for explode/collapse UDFs, normalize bbox arrays to lists, and convert embeddings with.tolist()at the LanceDB record boundary.TextChunkCPUActorinto the same pandas-output contract for extract-only chunking paths where explode does not run.This PR does not change the legacy
pipeline/content.pyimplementation, StoreOperator or_stored_image_uri, Arrow representation ofimages, pickle warning policy, dedup bbox handling, or BrowseComp storage behavior.Bug mapping
preserve_pandas_outputTextChunkCPUActor.PRESERVE_PANDAS_OUTPUTtext_imageregressionRegression coverage
test_explode_text_image_does_not_boolean_evaluate_numpy_bboxexercises the failing--embed-modality text_imagepath.test_collapse_returns_iterrows_safe_page_rowsverifies rebuilt page rows remain iterable after the Arrow-backed collapse boundary.Validation
Tested with the QA stack overlay using Ray 2.57.0, PyArrow 24.0.0, and Pandas 2.3.3: