• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

deepset-ai / haystack / 13453333627

21 Feb 2025 08:55AM UTC coverage: 90.155% (-1.0%) from 91.142%
13453333627

push

github

web-flow
perf: Optimize import times (#8878)

* initial experiments

* progress

* draft

* fix header

* fix linting

* lot more lazy inits

* fixes to main init

* linting

* small refinements

* header fix

* release note

* improve consistency

* test: make sure no extra modules are being imported due to `__init__` definitions

* extend release note with an example

* refactoring import test

* updating release notes

* casting .keys() to list

* reverting to list

* Update haystack/__init__.py

Co-authored-by: Julian Risch <julian.risch@deepset.ai>

* fixing ident problem

* better comments

---------

Co-authored-by: David S. Batista <dsbatista@gmail.com>
Co-authored-by: Julian Risch <julian.risch@deepset.ai>

9496 of 10533 relevant lines covered (90.15%)

0.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
haystack/components/classifiers/__init__.py
1
# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai>
2
#
3
# SPDX-License-Identifier: Apache-2.0
4

5
import sys
1✔
6
from typing import TYPE_CHECKING
1✔
7

8
from lazy_imports import LazyImporter
1✔
9

10
_import_structure = {
1✔
11
    "document_language_classifier": ["DocumentLanguageClassifier"],
12
    "zero_shot_document_classifier": ["TransformersZeroShotDocumentClassifier"],
13
}
14

15
if TYPE_CHECKING:
1✔
16
    from .document_language_classifier import DocumentLanguageClassifier
×
17
    from .zero_shot_document_classifier import TransformersZeroShotDocumentClassifier
×
18

19
else:
20
    sys.modules[__name__] = LazyImporter(name=__name__, module_file=__file__, import_structure=_import_structure)
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc