Skip to content

feat(connector-builder): stop setting the staging_file_url and file_size_bytes fields for the case of a Builder test read.#631

Merged
Aldo Gonzalez (aldogonzalez8) merged 1 commit into
mainfrom
aldogonzalez8/connector-builder/reduce-file-data
Jul 1, 2025
Merged

feat(connector-builder): stop setting the staging_file_url and file_size_bytes fields for the case of a Builder test read.#631
Aldo Gonzalez (aldogonzalez8) merged 1 commit into
mainfrom
aldogonzalez8/connector-builder/reduce-file-data

Conversation

@aldogonzalez8
Copy link
Copy Markdown
Contributor

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) commented Jul 1, 2025

Stop setting the staging_file_url and file_size_bytes fields for the case of a Builder test read.

File Upload UX improvements

Summary by CodeRabbit

  • Bug Fixes

    • Adjusted file upload behavior to include only the "source_file_relative_path" in uploaded data, rather than multiple file reference attributes.
  • Tests

    • Updated tests to reflect the change by removing checks for "staging_file_url" and "file_size_bytes" in the uploaded data.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 1, 2025

📝 Walkthrough

Walkthrough

The upload method in the ConnectorBuilderFileUploader class was updated to assign only the "source_file_relative_path" from the file reference to the record's data, instead of copying all non-private attributes. Corresponding unit tests were adjusted to remove assertions for the excluded fields.

Changes

Files / Paths Change Summary
airbyte_cdk/sources/declarative/retrievers/file_uploader/connector_builder_file_uploader.py Modified upload method to assign only "source_file_relative_path" from file reference to record data.
unit_tests/sources/declarative/file/test_file_stream.py Removed assertions for "staging_file_url" and "file_size_bytes" fields in relevant test.

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • maxi297

Would you like to consider updating the documentation or comments to clarify the new, narrower data copying behavior in upload, wdyt?


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5824a5e and 1fc7aa5.

📒 Files selected for processing (2)
  • airbyte_cdk/sources/declarative/retrievers/file_uploader/connector_builder_file_uploader.py (1 hunks)
  • unit_tests/sources/declarative/file/test_file_stream.py (0 hunks)
💤 Files with no reviewable changes (1)
  • unit_tests/sources/declarative/file/test_file_stream.py
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ChristoGrab
PR: airbytehq/airbyte-python-cdk#58
File: airbyte_cdk/sources/declarative/yaml_declarative_source.py:0-0
Timestamp: 2024-11-18T23:40:06.391Z
Learning: When modifying the `YamlDeclarativeSource` class in `airbyte_cdk/sources/declarative/yaml_declarative_source.py`, avoid introducing breaking changes like altering method signatures within the scope of unrelated PRs. Such changes should be addressed separately to minimize impact on existing implementations.
airbyte_cdk/sources/declarative/retrievers/file_uploader/connector_builder_file_uploader.py (3)
Learnt from: aaronsteers
PR: airbytehq/airbyte-python-cdk#58
File: airbyte_cdk/cli/source_declarative_manifest/_run.py:62-65
Timestamp: 2024-11-15T01:04:21.272Z
Learning: The files in `airbyte_cdk/cli/source_declarative_manifest/`, including `_run.py`, are imported from another repository, and changes to these files should be minimized or avoided when possible to maintain consistency.
Learnt from: ChristoGrab
PR: airbytehq/airbyte-python-cdk#58
File: airbyte_cdk/sources/declarative/yaml_declarative_source.py:0-0
Timestamp: 2024-11-18T23:40:06.391Z
Learning: When modifying the `YamlDeclarativeSource` class in `airbyte_cdk/sources/declarative/yaml_declarative_source.py`, avoid introducing breaking changes like altering method signatures within the scope of unrelated PRs. Such changes should be addressed separately to minimize impact on existing implementations.
Learnt from: ChristoGrab
PR: airbytehq/airbyte-python-cdk#90
File: Dockerfile:16-21
Timestamp: 2024-12-02T18:36:04.346Z
Learning: Copying files from `site-packages` in the Dockerfile maintains compatibility with both the old file structure that manifest-only connectors expect and the new package-based structure where SDM is part of the CDK.
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Check: source-hardcoded-records
  • GitHub Check: Check: source-pokeapi
  • GitHub Check: Check: source-amplitude
  • GitHub Check: Check: source-intercom
  • GitHub Check: Check: source-shopify
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Analyze (python)
🔇 Additional comments (1)
airbyte_cdk/sources/declarative/retrievers/file_uploader/connector_builder_file_uploader.py (1)

24-24: ✅ Change approved & no downstream impacts detected

  • Verified that no tests or code reference record.data["staging_file_url"] or record.data["file_size_bytes"], so the narrowed assignment won’t break any existing behavior.
  • The selective copying of only source_file_relative_path aligns perfectly with the PR goal.

Could we remove the # type: ignore now that this line is focused and should type-check cleanly? Or, if necessary, replace it with a more specific ignore (e.g., # type: ignore[attr-defined]) to narrow the scope — wdyt?

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 1, 2025

PyTest Results (Fast)

3 676 tests  ±0   3 665 ✅ ±0   6m 32s ⏱️ +16s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 1fc7aa5. ± Comparison against base commit 5824a5e.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 1, 2025

PyTest Results (Full)

3 679 tests  ±0   3 668 ✅ ±0   18m 4s ⏱️ +4s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 1fc7aa5. ± Comparison against base commit 5824a5e.

Copy link
Copy Markdown
Contributor

@lmossman Lake Mossman (lmossman) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM

@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) merged commit 4644271 into main Jul 1, 2025
27 checks passed
@aldogonzalez8 Aldo Gonzalez (aldogonzalez8) deleted the aldogonzalez8/connector-builder/reduce-file-data branch July 1, 2025 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants