Skip to content

test: type-check test/components/embedders and add it to mypy config#11859

Open
omborda2002 wants to merge 1 commit into
deepset-ai:mainfrom
omborda2002:chore/type-check-test-components-embedders
Open

test: type-check test/components/embedders and add it to mypy config#11859
omborda2002 wants to merge 1 commit into
deepset-ai:mainfrom
omborda2002:chore/type-check-test-components-embedders

Conversation

@omborda2002

Copy link
Copy Markdown

Related Issues

Proposed Changes:

Next piece-meal step for #10396, this one covers test/components/embedders/.

  • Added test/components/embedders/ to the test:types mypy paths in pyproject.toml
  • Fixed the 21 mypy errors in that folder, preferring real fixes over ignores:
    • built a proper Usage object in test_openai_text_embedder.py instead of passing a raw dict
    • annotated the empty_list_input variables as list[Document]
    • added assert embedder.embedding_backend is not None after warm_up() in the sentence transformers tests that set .model.max_seq_length, since the attribute is Optional before warm up
    • used scoped # type: ignore[arg-type] / # type: ignore[call-arg] only where a test passes a wrong type on purpose to check the raised TypeError

How did you test it?

  • hatch run test:types passes with the new folder included (no issues in 394 source files)
  • hatch run test:unit test/components/embedders/ passes (163 tests)
  • hatch run fmt is clean

Notes for the reviewer

Tests and CI config only, so I did not add a release note file (same as #11728).

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@omborda2002 omborda2002 requested a review from a team as a code owner July 3, 2026 10:37
@omborda2002 omborda2002 requested review from bogdankostic and removed request for a team July 3, 2026 10:37
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

@omborda2002 is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Jul 3, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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