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

deepset-ai / haystack / 15062869495

16 May 2025 07:15AM UTC coverage: 90.445% (+0.002%) from 90.443%
15062869495

push

github

web-flow
fix: Improve typing of @component and allow TypedDict output types (#9396)

- Add type annotations to the `_Component.__call__` function that
  backs `@component`. This fixes "decorator ignored" warnings of
  Pyright in "strict" type-checking mode.

- Type-check that a `@component` class conforms to the `Component`
  protocol (i.e., that it has a `run()` method).

- Relax the `run()` return type required by the `Component` protocol
  from `Dict[str, Any]` to `Mapping[str, Any]`. The former is
  incompatible with `TypedDict`, which makes it impossible to
  type a component's precise outputs. `Mapping` fixes this because
  it is covariant, i.e. the value type may be more specific than
  `Any`.

10942 of 12098 relevant lines covered (90.44%)

0.9 hits per line

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

98.91
haystack/core/component/component.py


Source Not Available

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