Repository navigation
Add dashAI document data structure and database model - #920
Merged
Merged
Conversation
cristian-tamblay
approved these changes
Oct 14, 2026
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
First of a stacked series that turns the Datasets module into a Data module holding two kinds of data: datasets and documents. This branch only adds the document data structure and its database record; nothing in the UI changes yet.
DashAIDatais a new common base forDashAIDatasetand the newDashAIDocument.DashAIDocumentholds parsed content split by DashAI type (Text,Image) in Arrow tables, keeping the reading order (position) and the sourcepageof every item, so tools that already restrict themselves by DashAI type can work on documents.document.json), and every path into a document validates its contents.data_documenttable and theDataDocumentmodel store uploaded documents, with aDocumentStatusenum for their parsing job.Type of Change
Check all that apply like this [x]:
Changes (by file)
DashAI/back/dataloaders/classes/dashai_data.py: newDashAIDatabase class shared by datasets and documents (data_kind()).DashAI/back/dataloaders/classes/dashai_dataset.py:DashAIDatasetnow extendsDashAIData.DashAI/back/dataloaders/classes/dashai_document.py:DocumentItem,DashAIDocument(from_items,items,types,count,as_dataset,with_content),save_document/load_documentwith atomic writes and strict validation (types, non null content, image bytes, pages from 1, positions unique across types).DashAI/back/dependencies/database/models.py:DataDocumentmodel (name, file info and hash, dataloader and params, content counts, pages, folder, job id, status).DashAI/back/core/enums/status.py:DocumentStatus.DashAI/alembic/versions/a7c3e91b5d20_add_data_document.py: migration creatingdata_document.tests/back/dataloaders/test_dashai_data.py,test_dashai_document.py,test_document_persistence.py: document structure, reading order and save/load round trips.tests/back/dependencies/test_data_document_model.py,tests/back/migrations/test_add_data_document.py: model and migration (upgrade, downgrade, ORM parity).Notes (optional)
develop. The next PR,feat/document-dataloaders, builds on this one.a7c3e91b5d20; starting the app upgrades the local database.documenttable is untouched here; it is replaced infeat/rag-data-documents.