refactor: make github/uniq consistent, drop unused _open_read_stream - #348
Merged
Merged
Conversation
…ead_stream github/uniq was the only wrapper passing a raw bytes-returning reader into a generic command; every other backend already passes an async generator. Wrap github_read in stream_from_bytes like its siblings, consume read_stream directly in generic/uniq, and delete the now-unused _open_read_stream helper.
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.
github/uniqwas the only command wrapper in the repo passing a raw bytes-returning reader (partial(github_read, ...)) into a generic command. Every other backend (and every other github command) already wraps its reader in an async generator before passing it in.This made the
_open_read_streamhelper exist solely to normalize that one wiring. The fix:github/uniqnow wrapsgithub_readinstream_from_bytes, matchinggithub/cut/github/awk/etc.generic/uniqconsumesread_stream(accessor, p)directly (likegeneric/cut); its typeCallable[..., AsyncIterator[bytes]]is now accurate._open_read_streamdeleted fromutils/stream.py(no remaining consumers).test_read_stream_returning_bytes, which covered the removed contract.Net: one rule everywhere, backends always pass an async generator and generics never normalize. TS already follows this (uniqGeneric is typed to require a stream fn).
Replaces #344, which spread the helper to 13 generics to guard a reader shape no backend actually produces.