Skip to content

MAINT: Delete unused _TextEmbedding ABC#1742

Merged
romanlutz merged 1 commit into
microsoft:mainfrom
romanlutz:romanlutz/delete-unused-text-embedding
May 19, 2026
Merged

MAINT: Delete unused _TextEmbedding ABC#1742
romanlutz merged 1 commit into
microsoft:mainfrom
romanlutz:romanlutz/delete-unused-text-embedding

Conversation

@romanlutz
Copy link
Copy Markdown
Contributor

Description

The _TextEmbedding abstract base class in pyrit/embedding/_text_embedding.py is dead code:

  • Nothing in the repo extends it. OpenAITextEmbedding inherits from EmbeddingSupport directly and re-implements its own tenacity retry logic in generate_text_embedding_async.
  • The file has zero importers (no references to either the _text_embedding module or the _TextEmbedding symbol anywhere in pyrit/, tests/, or doc/).

Deleting the file removes 58 lines of confusing dead code from the embedding module.

Tests and Documentation

No tests or docs reference the deleted class. Verified by running the existing embedding test suite locally:

  • tests/unit/embedding/ and tests/unit/memory/test_memory_embedding.py (12 tests) all pass.
  • from pyrit.embedding import OpenAITextEmbedding still imports cleanly.

No documentation updates needed; the public pyrit.embedding API (OpenAITextEmbedding) is unchanged.

The _TextEmbedding abstract base class in pyrit/embedding/_text_embedding.py
had no subclasses (OpenAITextEmbedding extends EmbeddingSupport directly
and re-implements its own retry logic) and no importers anywhere in the
repository. Remove the dead file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@hannahwestra25 hannahwestra25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow we didn't even include it in the init.py

@hannahwestra25 hannahwestra25 self-assigned this May 19, 2026
@romanlutz romanlutz added this pull request to the merge queue May 19, 2026
Merged via the queue into microsoft:main with commit 51052dd May 19, 2026
48 checks passed
@romanlutz romanlutz deleted the romanlutz/delete-unused-text-embedding branch May 19, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants