fix: update AirbyteTracedException.__str__ to show user-facing message (AI-Triage PR)#927
Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Draft
Conversation
Move the __str__ override from the MessageRepresentationAirbyteTracedErrors subclass into the base AirbyteTracedException class so that str(exception) returns the user-facing message globally, falling back to internal_message. Remove the now-unnecessary MessageRepresentationAirbyteTracedErrors subclass and update the two raise sites in HttpClient to use AirbyteTracedException directly. Co-Authored-By: bot_apk <[email protected]>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1772482932-fix-traced-exception-str#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1772482932-fix-traced-exception-strPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
PyTest Results (Full)3 872 tests 3 860 ✅ 11m 19s ⏱️ Results for commit 07d84bc. |
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.
fix: update AirbyteTracedException.str to show user-facing message
Summary
Moves the
__str__override from the temporaryMessageRepresentationAirbyteTracedErrorssubclass into the baseAirbyteTracedExceptionclass, so thatstr(exception)returns the user-facingmessageglobally (falling back tointernal_messageifmessageis not set).The subclass
MessageRepresentationAirbyteTracedErrorsinhttp_client.pywas an acknowledged workaround — its own docstring stated this behavior should eventually be promoted to the base class. This PR completes that migration.Changes:
airbyte_cdk/utils/traced_exception.py: Add__str__that returnsself.message→self.internal_message→""airbyte_cdk/sources/streams/http/http_client.py: RemoveMessageRepresentationAirbyteTracedErrorsclass; update two raise sites to useAirbyteTracedExceptiondirectlyResolves https://github.com/airbytehq/airbyte-internal-issues/issues/15916:
Review & Testing Checklist for Human
__str__change: This changes behavior for everyAirbyteTracedExceptionsubclass across the CDK, not just the two sites inhttp_client.py. Search forstr(e),f"{e}", and logging calls that stringify caughtAirbyteTracedExceptioninstances to verify no critical debug info is lost in logs or error tracking.super().__init__(internal_message): The constructor still passesinternal_messagetoException.__init__, soexception.args[0]remainsinternal_messagewhilestr(exception)now returnsmessage. Confirm this mismatch doesn't break anything (e.g., traceback formatting, Sentry grouping).__str__behavior: Existing tests pass because they only setinternal_message(hitting the fallback path). Consider adding an explicit test where bothmessageandinternal_messageare set to verifystr()returnsmessage.Suggested test plan: Run the full CDK test suite (
poetry run poe pytest-fast). Additionally, grep the codebase forstr(patterns onAirbyteTracedExceptionand its subclasses to manually verify the behavioral change is safe.Notes