Skip to content

chore: enable ANN ruff ruleset for elasticsearch integration#2986

Merged
julian-risch merged 1 commit intomainfrom
feat/elasticsearch-type-annotations
Mar 18, 2026
Merged

chore: enable ANN ruff ruleset for elasticsearch integration#2986
julian-risch merged 1 commit intomainfrom
feat/elasticsearch-type-annotations

Conversation

@julian-risch
Copy link
Copy Markdown
Member

@julian-risch julian-risch commented Mar 18, 2026

Related Issues

None

Proposed Changes:

  • Add ANN (flake8-annotations) to ruff select in pyproject.toml
  • Add ANN401 to ruff ignore (allow Any for **kwargs and Elasticsearch SDK boundaries)
  • Exclude tests/**/* from ANN checks via per-file-ignores
  • Add -> None return type annotations to __init__ in ElasticsearchBM25Retriever, ElasticsearchEmbeddingRetriever, ElasticsearchSQLRetriever, and ElasticsearchDocumentStore
  • Add -> None return type annotation to _ensure_initialized in ElasticsearchDocumentStore

How did you test it?

Ran tests locally

Notes for the reviewer

Checklist

Add ANN (flake8-annotations) to ruff select, ignore ANN401 (Any is used
legitimately for **kwargs and ES SDK boundaries), exclude tests from ANN
checks, and add missing -> None return type annotations to __init__ and
_ensure_initialized.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@julian-risch julian-risch marked this pull request as ready for review March 18, 2026 13:52
@julian-risch julian-risch requested a review from a team as a code owner March 18, 2026 13:52
@julian-risch julian-risch requested review from sjrl and removed request for a team March 18, 2026 13:52
@julian-risch julian-risch merged commit 7d7a7e7 into main Mar 18, 2026
9 checks passed
@julian-risch julian-risch deleted the feat/elasticsearch-type-annotations branch March 18, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants