Conversation
ClemDoum
force-pushed
the
refactor(datashare-python)/normalize-error-reporting
branch
14 times, most recently
from
September 23, 2026 13:20
2b0a409 to
13fbf2c
Compare
ClemDoum
force-pushed
the
refactor(datashare-python)/normalize-error-reporting
branch
from
September 23, 2026 14:26
13fbf2c to
156f86b
Compare
ClemDoum
marked this pull request as ready for review
September 23, 2026 14:27
This branch has not been deployed
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.
Description
Addresses #89,
Aggregated results and errors reporting normalization
This PRs aims at factorizing and normalizing error reporting and aggregated statistics reporting accross workers.
Prior to it the passport worker and extract worker were reporting aggregated stats and errors in their own format.
Since the ASR worker was also expected to report those too, it was the occasion to factorize.
Errors are now reported with a minimal Problem Detail RFC implementation:
When errors are serialiazed in the output payload, details are omitted for security + payload size.
At a workflow levels the number of processed documents (total or successful) can be reported using
ProcessingReportorProcessingReportWithPagesif want page level information:Errors at the document or page level can be reported using
ErrorReport.The error report contains workflows level stats about the number of failed docs / page but all errors per failing document.
Since a document can be processed in several piece (typically when processed by page or page batch), there can be many different errors for a single document. In the
ErrorReporterrors are grouped per document inside theDocProcessingErrors:Hence the error report looks like:
Intermediate results tracing factorization
A document can be transformed many times before an error occur. Additionnally, many different errors can affect the same document as documents can be split into pages or page chunks to be processed. This makes error tracking and aggregration a bit tidious.
To help error aggregation and to improve debugging, a intermediate result mechanism was implemented (
ProcessingResult) or more precisely refactored from the existing one in the passport worker in order to serialize intermediate results with trace to their parent (FromParent/WithParenthelper classes).This makes it very easy backtrack to the original
Documentfrom the index which was the root of the intermediate results and thus makes it easy to debug + aggregate errors at the document level.To help with this logic a few objects were introduced/refactored in addition to the existing ones.
Document: represents a Datashare document from the index. Files from the index are stored somewhere, either on the filesystem either or as an artifact.A document which has been located on the filesystem is called
DatashareFile, this file can be transforme into subsequent intermediate results like this:All intermediate results are created using the
from_parentclass method which lets us backtrack to the original document.A generic
WorkerFilewas create for the common case the the intermediate result is a file persisted on the workdir (passport pages converted to pngs, document converted as PDF, embedded document symlinked to the workdir with a propery file name and extension...)Changes
datashare-pythonChanged
DocumentLocationtoFileLocationAdded
WorkerFilePathobject to reprensent a file located on the worker filesystemErrorSource,ErrorSourceWithPagesProcessingErrorto hold anErrorand its sourceProcessingReport,ProcessingReportWithPages,DocProcessingErrorsasr-workerAdded
Changed