fix(file-based): classify CSV encoding errors as config_error to prevent unnecessary retries#1054
Draft
devin-ai-integration[bot] wants to merge 1 commit into
Draft
Conversation
…ent unnecessary retries The AirbyteTracedException raised for UnicodeError in csv_parser.py was missing failure_type, defaulting to system_error (retriable). This caused up to 5 unnecessary retry attempts for encoding mismatch errors that will never succeed without a config change. - Add failure_type=FailureType.config_error - Add internal_message with file URI, encoding, and original error - Pass exception parameter and chain with 'from e' - Update test to verify all new exception attributes Co-Authored-By: bot_apk <apk@cognition.ai>
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/1781541430-fix-csv-encoding-error-failure-type#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/1781541430-fix-csv-encoding-error-failure-typePR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
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.
Summary
The
AirbyteTracedExceptionraised forUnicodeErrorincsv_parser.py:76-79was missingfailure_type, defaulting toFailureType.system_error(retriable). This caused up to 5 unnecessary retry attempts for encoding mismatch errors — a deterministic config problem that will never succeed without a user config change.This matches the pattern already used by adjacent validators in the same file (e.g.,
_validate_trailing_headersat lines 178-189).Breaking Change Evaluation
Not a breaking change. This only changes the
failure_typeclassification of an existing error fromsystem_errortoconfig_error, reducing wasted retries.Declarative-First Evaluation
N/A — this is a CDK-level Python fix, not a connector manifest change.
Test Coverage
Updated the existing
test_read_data_with_encoding_errortest to verify:failure_type == FailureType.config_errorinternal_messagecontains file URI and encoding__cause__Resolves https://github.com/airbytehq/oncall/issues/11649:
Link to Devin session: https://app.devin.ai/sessions/349ff681df434e669c27803cade26a6e