Conversation
Both helpers ended with `raise f'invalid data type ...'`. Raising a str is itself an error, so callers got "TypeError: exceptions must derive from BaseException" and the intended message was lost. Raise a TypeError with the message, which keeps the exception class callers already see. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Casper Nielsen <casper@diagrid.io>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1229 +/- ##
==========================================
+ Coverage 83.89% 83.91% +0.01%
==========================================
Files 123 123
Lines 10265 10265
==========================================
+ Hits 8612 8614 +2
+ Misses 1653 1651 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 24, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 24, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 24, 2026
Contributor
Author
|
Closing in favor of #1220 that came first |
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
to_bytesandto_strindapr/clients/grpc/_helpers.pyended withraise f'invalid data type {type(data)}'. Raising a string is itself an error in Python, so a caller who passed the wrong type gotTypeError: exceptions must derive from BaseExceptionand never saw the real message. Both now raiseTypeError(f'invalid data type {type(data)}'). Callers already got aTypeError, so anyone catching it is unaffected; they just get the right message now. Added unit tests for both helpers. A repo-wide search found no otherraiseof a string.RELEASE NOTE: FIX
to_bytesandto_strnow raise aTypeErrorwith a clear message when given a value that is neither str nor bytes.Issue reference
Please reference the issue this PR will close: N/A, found while reviewing #1228, no existing issue filed.
Checklist
🤖 Generated with Claude Code