Skip to content

Commit 8c1e6e8

Browse files
committed
fix(extract-core): linting and test
1 parent 2f08e5c commit 8c1e6e8

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎extract-core/extract_core/docling_.py‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,12 @@ def to_docling(self, device: Device) -> BaseFormatOption: # noqa: ANN201
245245

246246

247247
def _default_format_opts() -> dict[InputFormat, DoclingFormatOption]:
248-
from docling.backend.json.docling_json_backend import DoclingJSONBackend
249-
from docling.backend.mets_gbs_backend import MetsGbsDocumentBackend
250-
from docling.backend.webvtt_backend import WebVTTDocumentBackend
251-
from docling.document_converter import (
248+
from docling.backend.json.docling_json_backend import ( # noqa: PLC0415
249+
DoclingJSONBackend,
250+
)
251+
from docling.backend.mets_gbs_backend import MetsGbsDocumentBackend # noqa: PLC0415
252+
from docling.backend.webvtt_backend import WebVTTDocumentBackend # noqa: PLC0415
253+
from docling.document_converter import ( # noqa: PLC0415
252254
AsciiDocFormatOption,
253255
AudioFormatOption,
254256
DclxFormatOption,
@@ -269,8 +271,10 @@ def _default_format_opts() -> dict[InputFormat, DoclingFormatOption]:
269271
XMLDocLangFormatOption,
270272
XMLJatsFormatOption,
271273
)
272-
from docling.pipeline.simple_pipeline import SimplePipeline
273-
from docling.pipeline.standard_pdf_pipeline import StandardPdfPipeline
274+
from docling.pipeline.simple_pipeline import SimplePipeline # noqa: PLC0415
275+
from docling.pipeline.standard_pdf_pipeline import ( # noqa: PLC0415
276+
StandardPdfPipeline,
277+
)
274278

275279
default = {
276280
InputFormat.CSV: CsvFormatOption(),
@@ -315,7 +319,7 @@ def _default_format_opts() -> dict[InputFormat, DoclingFormatOption]:
315319
pipeline_opts = opts.pipeline_options
316320
if pipeline_opts is not None:
317321
pipeline_opts = _dump_pipeline_opts_with_kind(pipeline_opts)
318-
opts = DoclingFormatOption(
322+
opts = DoclingFormatOption( # noqa: PLW2901
319323
backend=opts.backend.__name__,
320324
backend_options=opts.backend_options,
321325
pipeline_cls=opts.pipeline_cls.__name__,

‎extract-core/tests/test_objects.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_docling_pipeline_config() -> None:
2727
"format_options": {
2828
"pdf": {
2929
"pipeline_cls": "StandardPdfPipeline",
30-
"backend": "DoclingParseDocumentBackend",
30+
"backend": "ThreadedDoclingParseDocumentBackend",
3131
"pipeline_options": {
3232
"ocr_options": {"kind": "tesserocr", "lang": ["auto"]},
3333
"generate_picture_images": True,

0 commit comments

Comments
 (0)