Skip to content

Conversation

@aldogonzalez8
Copy link
Contributor

@aldogonzalez8 aldogonzalez8 commented Apr 22, 2025

Fix the file name field to the one in the schema:

file_transfer_schema = {
    "type": "object",
    "properties": {
        "folder": {"type": "string"},
        "file_name": {"type": "string"},
        "source_uri": {"type": "string"},
        "bytes": {"type": "integer"},
        "id": {"type": ["null", "string"]},
        "created_at": {"type": ["null", "string"]},
        "updated_at": {"type": ["null", "string"]},
        "mime_type": {"type": ["null", "string"]},
    },
}

Summary by CodeRabbit

  • Refactor

    • Updated the file name attribute in record data from "filename" to "file_name" throughout the application.
  • Tests

    • Adjusted tests to reflect the updated attribute name for file records.

@aldogonzalez8 aldogonzalez8 self-assigned this Apr 22, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 22, 2025

📝 Walkthrough

Walkthrough

The changes update the attribute name in the FileRecordData class from filename to file_name within the Airbyte CDK. Corresponding updates are made in the unit tests to reflect this new attribute name in both the test data and the expected output structure. No other modifications to logic, structure, or functionality are introduced.

Changes

File(s) Change Summary
airbyte_cdk/sources/file_based/file_record_data.py Renamed the FileRecordData class attribute from filename to file_name.
unit_tests/sources/file_based/stream/test_default_file_based_stream.py Updated test data and assertions to use file_name instead of filename.

Suggested labels

bug, airbyte-python-cdk

By the way, would you like to double-check for any typos like filen_ame in the test attribute names to ensure consistency throughout the codebase, 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 5de055d and f68547b.

📒 Files selected for processing (1)
  • unit_tests/sources/file_based/stream/test_default_file_based_stream.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • unit_tests/sources/file_based/stream/test_default_file_based_stream.py
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-google-drive' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • 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)

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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4f0fcbc and 5de055d.

📒 Files selected for processing (2)
  • airbyte_cdk/sources/file_based/file_record_data.py (1 hunks)
  • unit_tests/sources/file_based/stream/test_default_file_based_stream.py (2 hunks)
🧰 Additional context used
🪛 GitHub Actions: Pytest (Fast)
unit_tests/sources/file_based/stream/test_default_file_based_stream.py

[error] 284-286: pydantic.v1.error_wrappers.ValidationError: 1 validation error for FileRecordData - field 'file_name' required but missing

🪛 GitHub Actions: PyTest Matrix
unit_tests/sources/file_based/stream/test_default_file_based_stream.py

[error] 284-286: pydantic.v1.error_wrappers.ValidationError: 1 validation error for FileRecordData - field 'file_name' required but missing.

⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-google-drive' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Analyze (python)
🔇 Additional comments (2)
airbyte_cdk/sources/file_based/file_record_data.py (1)

17-17: Renaming field from filename to file_name aligns with schema definition.

The change from filename to file_name fixes the schema field alignment issue mentioned in the PR objectives. This ensures consistency between the code and schema definition, which is a good improvement.

unit_tests/sources/file_based/stream/test_default_file_based_stream.py (1)

340-340: Updating dictionary key to match the renamed field.

The update to change "filename" to "file_name" in the expected output is correct and consistent with the field rename in the FileRecordData class.

@aldogonzalez8 aldogonzalez8 changed the title bug(file-api): fix schema field for file name fix(file-api): fix schema field for file name Apr 22, 2025
@aldogonzalez8 aldogonzalez8 merged commit 2f29eff into main Apr 22, 2025
30 of 33 checks passed
@aldogonzalez8 aldogonzalez8 deleted the ac8/file-transfer/fix-schema-helper branch April 22, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants