Repository navigation
Integrate document job with Units and add hub import support - #929
Merged
Merged
Conversation
cristian-tamblay
force-pushed
the
feat/document-job-units
branch
from
October 21, 2026 16:15
602101b to
71cbf7b
Compare
cristian-tamblay
approved these changes
Oct 21, 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
DocumentJobis now built from atomic units, like the dataset, converter and explainer jobs. The source file can come from an upload or from a completed hub download, so files downloaded through the Datafile Hub can be imported as documents. The hub import page lists document extractors next to data loaders, grouped by category the same way as the Upload data page.Based on
feat/rag-vectorizer-converters.Type of Change
Check all that apply like this [x]:
Changes (by file)
Backend
DashAI/back/units/store_uploaded_document_source_unit.py: new unit that copies an upload into the document'ssource/folder and publishessource_pathandfile_hash.upload_pathandfile_nameare runtime params.DashAI/back/units/store_datafile_document_source_unit.py: new unit that does the same for a file inside a completed hub download (datafile_id, optionalselected_file). The copy keeps the document independent of the download.DashAI/back/units/parse_document_unit.py: new unit that parsessource_pathwith a document loader and publishesdocument. Itsvalidaterejects a missing loader or a dataset loader before anything is copied.DashAI/back/units/save_document_to_path_unit.py: new unit that writesdocumentto a given directory, the document counterpart ofSaveDatasetToPathUnit.DashAI/back/units/document_source.py: helpers shared by the two source units (copy plus sha256, sharedpathschema field).DashAI/back/units/datafile_source.py: hub download lookup and file resolution moved out ofLoadDatafileDatasetUnitso both datafile units share it. Error messages are unchanged.DashAI/back/units/load_datafile_dataset_unit.py: uses the shared helper.DashAI/back/job/document_job.py:runnow composes the units. Withdatafile_idin kwargs the source comes from the hub download, otherwise from the upload. Status hooks, cancel cleanup and row bookkeeping are unchanged.DashAI/back/initial_components.py: registers the four new units.Frontend
DashAI/front/src/api/documents.ts:enqueueHubDocumentJobposts aDocumentJobto/v1/job/withdatafile_idandselected_fileand no file.DashAI/front/src/components/hub/HubImportPanel.jsx: lists dataset loaders and document extractors grouped by category. Picking an extractor replaces the preview step with a name field, creates the document and enqueues the hub job. Shows an error and blocks import when the extractor does not support the selected file, and reloads the file list when the page is opened past the file step.DashAI/front/src/pages/hub/HubImportPage.jsx: no longer filters out document loaders, showsDocumentLoaderConfigBarin the right panel for extractors, and opens the new document after import.DashAI/front/src/utils/i18n/locales/*/hub.json:documentName,importDocument,stepDocumentTitle,stepDocumentSubtitlein en, es, pt, de and zh.Tests
tests/back/units/test_document_ingest_units.py: contract tests for the four units.tests/back/api/test_document_job.py: hub import, download not ready, and enqueueing through/api/v1/job/without a file.tests/back/units/test_unit_contracts.py,tests/back/api/test_units_api.py: new units, schema fields and runtime params added to the audits.Testing (optional)
Notes (optional)
/dataset-source, since only the datafile is needed, not the source.