Feat: Delta Storage System with SQL View Architecture#42
Open
arnavg24-arch wants to merge 21 commits into
Open
Feat: Delta Storage System with SQL View Architecture#42arnavg24-arch wants to merge 21 commits into
arnavg24-arch wants to merge 21 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.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.
Overview
This PR implements a comprehensive Delta Storage system for the Buckaroo Visual Wrangler. The goal was to transition from simple data cloning to a functional, space-efficient architecture that supports full wrangling provenance and reproducible Pandas script generation.
Technical Implementation (Architecture : SQL Views)
Instead of physical state cloning, we have implemented a Functional Nesting Architecture using PostgreSQL Views:
Zero-Storage History
Each wrangling step is now a virtual SQL View rather than a hard table. This ensures the database size remains constant regardless of the number of undo/redo steps.
Virtualized Operation Mapping
Operations like delete-column, impute, and row-deletion are mapped to dynamic SQL rules such as CASE WHEN, WHERE NOT IN, and SELECT.
Nesting Logic
Each new node view refers to its parent view, creating a logical chain that the database engine unrolls for near-instant execution.
New Components
Delta Class (delta.py)
A standard data structure for capturing the intent of an operation, its parameters, and its translated Python code.
Pandas Mapper (pandas_mapper.py)
A translation layer that converts SQL-based visual selections into executable, production-ready Pandas code snippets.
Provenance Reassembler
Updated PGraph logic to traverse the history chain and stitch together a full, reproducible Python script for export.
Refactored Service Helpers
Integrated view generation into the preview and finalization pipelines.
Key Benefits
Efficiency
Prevents database bloat on large datasets.
Reproducibility
Added a new endpoint to provide users with the exact code needed to replicate their visual work in a Jupyter Notebook.
Scalability
Architecture matches modern data warehouse paradigms used in professional data tools.