MAINT: Delete unused _TextEmbedding ABC#1742
Merged
romanlutz merged 1 commit intoMay 19, 2026
Merged
Conversation
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>
hannahwestra25
approved these changes
May 19, 2026
Contributor
hannahwestra25
left a comment
There was a problem hiding this comment.
wow we didn't even include it in the init.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The _TextEmbedding abstract base class in pyrit/embedding/_text_embedding.py is dead code:
tenacityretry logic ingenerate_text_embedding_async._text_embeddingmodule or the_TextEmbeddingsymbol anywhere inpyrit/,tests/, ordoc/).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/andtests/unit/memory/test_memory_embedding.py(12 tests) all pass.from pyrit.embedding import OpenAITextEmbeddingstill imports cleanly.No documentation updates needed; the public
pyrit.embeddingAPI (OpenAITextEmbedding) is unchanged.