Repository navigation
perf: defer pandas import in ResponseToFileExtractor - #1221
Draft
devin-ai-integration[bot] wants to merge 1 commit into
Draft
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 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/1791494270-defer-pandas-import#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/1791494270-defer-pandas-importPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
PyTest Results (Fast)778 tests - 4 256 766 ✅ - 4 256 6m 7s ⏱️ - 4m 34s For more details on these failures, see this check. Results for commit dfc8407. ± Comparison against base commit 916d6f6. This pull request removes 4257 and adds 1 tests. Note that renamed tests count towards both. |
This was referenced Oct 9, 2026
This branch has not been deployed
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
response_to_file_extractor.pyimported pandas at module level. That module is always loaded on the declarative / SDM import path (extractors/__init__.py,model_to_component_factory.py,http_job_repository.py), so every manifest-only connector process imported pandas and numpy at start-up on every command, though none of them use it. pandas is only used inResponseToFileExtractor._read_with_chunks.This follows the same lazy-import approach as
unstructuredinfile_based/file_types/unstructured_parser.py. Behavior is unchanged, includingpreserve_na_values. The only consumer in the monorepo issource-salesforce, a Python connector. Its tests patchsource_salesforce.streams.ResponseToFileExtractor, not the module'spd.Measured locally on
main:import airbyte_cdk.cli.source_declarative_manifest._run→'pandas' in sys.modules, 'numpy' in sys.modules=True True, and-X importtimeattributes about 198 ms cumulative toresponse_to_file_extractor.False False, andresponse_to_file_extractortakes about 0.4 ms cumulative.Trade-off: a broken pandas/numpy install now fails on the first CSV parse instead of at process start. The existing
test_response_to_file_extractor.pytests still runpd.read_csv, so CI catches this.Resolves https://github.com/airbytehq/airbyte-internal-issues/issues/17921:
Close on merge: yes — internally filed, no customer to confirm with.
Part of https://github.com/airbytehq/airbyte-internal-issues/issues/17920 (faster
checkfor manifest-only connectors).Test Coverage
unit_tests/source_declarative_manifest/test_source_declarative_manifest_imports.py: runs SDMspec,check(HTTP mocked withrequests_mock) anddiscoveron the PokeAPI test manifest in a subprocess, so other tests can't pollutesys.modules. It then asserts that neitherpandasnornumpywas imported. Verified it fails without the fix (assert '["numpy", "pandas"]' == '[]') and passes with it.unit_tests/source_declarative_manifest/,unit_tests/sources/declarative/extractors/test_response_to_file_extractor.py,unit_tests/sources/declarative/requesters/: 536 passed.ruff check,ruff format,mypyon the changed file all pass.Declarative-First Evaluation
N/A. This is a CDK-internal import change, not a change to a connector manifest or custom component.
Breaking Change Evaluation
Not breaking: no schema, spec, state, stream or data-scope change. CDK versions come from release tooling, so this PR does not bump a version.
Link to Devin session: https://app.devin.ai/sessions/919705a00f754ff494dff1d2ed6f9a61
Open in Devin Desktop: https://app.devin.ai/desktop/session/919705a00f754ff494dff1d2ed6f9a61?variant=devin