fix(declarative): raise CSV field size limit in CsvParser - #1114
Draft
devin-ai-integration[bot] wants to merge 1 commit into
Draft
fix(declarative): raise CSV field size limit in CsvParser#1114devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: lucas.leadbetter@airbyte.io <5595530+lleadbet@users.noreply.github.com>
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:
|
2 tasks
👋 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/1786550116-declarative-csv-field-size#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/1786550116-declarative-csv-field-sizePR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Contributor
Author
|
Cross-reference: #1116 was opened from a separate Devin session for the same oncall issue and is a superset of this change (also adds an optional |
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 declarative
CsvParser(sources/declarative/decoders/composite_raw_decoder.py) never calledcsv.field_size_limit, so any low-code connector reading a CSV response failed on a single value larger than Python's default 131,072 characters:The file-based CDK parser has raised this to
2**31since airbytehq/airbyte#36320 (sources/file_based/file_types/csv_parser.py:261-269), but that is a separate parser implementation. Becausecsv.field_size_limitis process-global, the declarative path's effective limit was whatever the process happened to have — i.e. it depended on whether the file-based parser module had been imported, which is not something a manifest author controls.This sets the limit explicitly in the declarative parser, using the same value as the file-based parser so the two paths agree:
Reported by a customer whose source carried a 152,579-character free-text field: the affected records simply did not come through, with nothing in the connection configuration indicating a size cap.
Deliberately out of scope: exposing this as a
CsvDecodermanifest option (nodeclarative_component_schema.yamlchange). Happy to add it if reviewers would rather it be configurable per connector than a fixed default.Test plan
New regression test in
unit_tests/sources/declarative/decoders/test_composite_decoder.pydecodes a 200 KiB single field value, with the global limit deliberately lowered to131_072beforehand (and restored after) so the test fails without the source change. Confirmed the pre-change failure mode isfield larger than field limit (131072).Also ran the declarative decoder suite (62 passed) and the file-based CSV parser suite (69 passed) to check the shared global limit change doesn't regress the other path.
Link to Devin session: https://app.devin.ai/sessions/474c9fe5bfca4e21acce8d128cba3c8a