Skip to content

enhancement: adopt PEP 585 type hinting generics in Core Integrations #2136

@anakin87

Description

@anakin87

Why

PEP 585 enabled collections in the Python standard library (like list) to be used as generics directly, instead of importing analogous members from the typing module (like typing.List).

When available, the PEP 585 syntax should be used instead of importing members from the typing module, as it's more concise and readable.

What to do

  • adopt these type hints in the Haystack Core Integrations codebase
  • add the corresponding ruff rule to pyproject.toml to enforce this requirement
  • (maybe splitting this work in multiple PRs, but not one for each integration could be better)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions