Feat: Implement NoSQL Parser #199
Open
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
This PR introduces the NoSQL Parser, a core feature that allows users to transform nested, semi-structured NoSQL data (like JSON or MongoDB collections) into normalized, relational tables suitable for analytical storage (Parquet).
It addresses the need for a reusable, standard way to flatten complex document structures while preserving parent-child relationships through automatically generated foreign keys.
Type of Change
🐛 Bug fix (non-breaking change which fixes an issue)
✨ New feature (non-breaking change which adds functionality)
💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
📝 Documentation update
🎨 Code style update (formatting, renaming)
♻️ Refactoring (no functional changes)
⚡ Performance improvement
✅ Test update
🔧 Configuration change
🏗️ Infrastructure/build change
Related Issue(s)
Fixes #107
Changes Made
Core Parser
(src/intugle/nosql/parser.py): Implemented recursive logic to split nested lists into separate child tables and generate foreign keys(parent_table_id)to maintain relationships.Schema Inference
(src/intugle/nosql/inference.py): Added logic to scan sample data, resolve type conflicts (e.g., unifying int and str), and auto-detect primary keys(_id, uuid).Parquet Writer
(src/intugle/nosql/writer.py): ImplementedParquetTargetto persist in-memoryDataFramesto disk usingpyarrow.Configuration: Added support for custom table renaming and Primary Key overrides via a config dictionary.
Dependencies: Added
pandasandpyarrowas optional dependencies under thenosqlextra inpyproject.toml.Testing
Test Configuration
Python Version: 3.13.2
OS: Windows 11
LLM Provider: N/A
Test Cases
Unit tests pass locally
Manual testing completed
Tested with sample datasets
Test Commands
# Run the NoSQL specific test suite pytest tests/nosql/Screenshots/Examples
Checklist
My code follows the code style of this project
I have performed a self-review of my own code
I have commented my code, particularly in hard-to-understand areas
I have made corresponding changes to the documentation
My changes generate no new warnings or linter errors
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes
Any dependent changes have been merged and published
I have updated the relevant notebooks (if applicable)
I have checked my code and corrected any misspellings
Documentation Updates
README.md updated
Docstrings added/updated
Documentation site updated (if needed)
Notebook examples updated (if applicable)
CHANGELOG updated (if applicable)
Breaking Changes
This PR introduces breaking changes
Migration guide provided (if applicable)
Performance Impact
Performance benchmarks run
No significant performance impact
Performance improvement:
Performance regression:
Additional Context
The parser uses recursive processing. Memory usage scales with the chunk size of the input data. Dependencies (pandas, pyarrow) are optional and must be installed via pip install intugle[nosql].
Deployment Notes
Users must install the optional extras to use this feature: