Add data operations module with CSV import and table manipulation#527
Merged
fdb merged 8 commits intorewrite-in-rustfrom Feb 15, 2026
Merged
Add data operations module with CSV import and table manipulation#527fdb merged 8 commits intorewrite-in-rustfrom
fdb merged 8 commits intorewrite-in-rustfrom
Conversation
Add DataValue type and DataRow/DataRows NodeOutput variants to support structured tabular data. The csv crate handles robust CSV parsing with configurable delimiters, quote characters, and number separators. Auto-detects numeric columns. Includes 19 unit tests. https://claude.ai/code/session_01Ssbet1itX47TACaYWBM1Wo
Kept upstream's new list nodes (pick, cull, take_every, distinct, switch, combine), network nodes, and section separators. Merged our full data node port definitions (import_csv with quotes/number_separator, make_table, lookup, filter_data) on top. https://claude.ai/code/session_01Ssbet1itX47TACaYWBM1Wo
The Widget::File handler was hardcoded to FileFilter::svg(). Now it selects filters based on the node prototype: CSV files for import_csv, text files for import_text, SVG for import_svg, and no filter for unknown nodes. https://claude.ai/code/session_01Ssbet1itX47TACaYWBM1Wo
Uses non-interactive TextEdit for the filename (same as string widget), with a "..." suffix on the right. The entire row is clickable and shows the same hover effect as other widgets. Clicking anywhere opens the file picker dialog. https://claude.ai/code/session_01Ssbet1itX47TACaYWBM1Wo
The data viewer now renders DataRows output as a proper spreadsheet-style table with separate columns for each CSV field, instead of flat strings. https://claude.ai/code/session_01Ssbet1itX47TACaYWBM1Wo
Both nodes were stubbed out waiting for map type support. Now that DataRow/DataRows exist in NodeOutput, replace the stubs with real implementations and register them in the node library. https://claude.ai/code/session_01Ssbet1itX47TACaYWBM1Wo
Change lookup's registered output from PortType::String to PortType::Data (matching the ndbx definition) and add Data → Float/Int/Point compatibility rules. The runtime already returns NodeOutput::Float for numeric columns; this fix lets the connection validator accept those wires. https://claude.ai/code/session_01Ssbet1itX47TACaYWBM1Wo
Data is a dynamic type (lookup can return float, string, color, etc. depending on the column). Treat it like List — compatible with any input or output port type, with runtime determining the actual value. https://claude.ai/code/session_01Ssbet1itX47TACaYWBM1Wo
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.
Summary
This PR introduces a new data operations module (
nodebox-ops::data) that provides functions for importing, creating, querying, and filtering tabular data. It adds support for structured data handling throughout the NodeBox system, including new node types and UI components.Key Changes
New Data Module (
crates/nodebox-ops/src/data.rs)StringorFloat, matching Java's DataFunctions behavior=,!=,>,>=,<,<=), with automatic numeric/string comparison fallbackGUI and Evaluation Updates (
crates/nodebox-gui/src/eval.rs)DataRowandDataRowsvariants toNodeOutputenumget_data_rows()andget_as_data_values()for type conversionvalue_to_output()to handleValue::Mapconversion toDataRowdata.import_csv: Reads CSV files with proper delimiter/quote handlingdata.make_table: Builds tables from multiple input listsdata.lookup: Retrieves values from data rowsdata.filter_data: Filters data rows by key-value comparisonsNode Library and UI (
crates/nodebox-gui/src/node_library.rs)import_text,import_csv,make_table,lookup,filter_dataType System Updates
PortType::Datavariant to support data/table ports in the node systemDependencies
csv = "1"crate tonodebox-opsfor robust CSV parsingImplementation Details
csvcrate for proper handling of quoted fields and various delimiters!=matches rows without the keyhttps://claude.ai/code/session_01Ssbet1itX47TACaYWBM1Wo