Skip to content

fix(core): add data source variant for file connectors #1114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

goldmedal
Copy link
Contributor

@goldmedal goldmedal commented Mar 26, 2025

Description

Add the missing data source type in wren-core-base.

Summary by CodeRabbit

  • New Features
    • Expanded file source support by clearly distinguishing between local files and several cloud storage options.
    • Improved display formatting for file source information, offering more consistent and informative labels for users.

Copy link

coderabbitai bot commented Mar 26, 2025

Walkthrough

This pull request adds a "dataSource" key to the manifest dictionaries in various test files, specifying the data origin for each test (GCS, local, Minio, and S3). Additionally, it extends the DataSource enum by introducing new variants in both the manifest macro and its display implementation, ensuring these data sources are recognized and formatted appropriately.

Changes

File(s) Change Summary
ibis-server/tests/routers/.../test_{gcs_file,local_file,minio_file,s3_file}.py Added a new "dataSource" key to the manifest dictionary with values "gcs_file", "local_file", "minio_file", and "s3_file" respectively, to provide additional context in tests.
wren-core-base/manifest-macro/src/lib.rs Expanded the DataSource enum by adding variants: LocalFile, S3File, GcsFile, and MinioFile with corresponding #[serde(alias = "...")] attributes.
wren-core-base/src/mdl/manifest.rs Enhanced the Display implementation for the DataSource enum by adding match arms for the new variants with formatted outputs: "LOCAL_FILE", "S3_FILE", "GCS_FILE", and "MINIO_FILE".

Possibly related PRs

Suggested labels

dependencies

Suggested reviewers

  • wwwy3y3

Poem

In the garden of code, I hop with delight,
Adding data sources to make tests shine bright.
GCS, local, S3, and Minio in line,
Each key a note in our code's design.
Hoppy trails of change—I'm a joyful rabbit tonight! 🐇


📜 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 c8ceca4 and 97c2809.

📒 Files selected for processing (6)
  • ibis-server/tests/routers/v2/connector/test_gcs_file.py (1 hunks)
  • ibis-server/tests/routers/v2/connector/test_local_file.py (1 hunks)
  • ibis-server/tests/routers/v2/connector/test_minio_file.py (1 hunks)
  • ibis-server/tests/routers/v2/connector/test_s3_file.py (1 hunks)
  • wren-core-base/manifest-macro/src/lib.rs (1 hunks)
  • wren-core-base/src/mdl/manifest.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: ci
🔇 Additional comments (6)
ibis-server/tests/routers/v2/connector/test_gcs_file.py (1)

80-80: LGTM! Adds appropriate data source type.

The addition of "dataSource": "gcs_file" to the manifest dictionary correctly identifies this test as using Google Cloud Storage as its data source, enhancing clarity in the test configuration.

ibis-server/tests/routers/v2/connector/test_minio_file.py (1)

78-78: LGTM! Adds appropriate data source type.

The addition of "dataSource": "minio_file" to the manifest dictionary correctly identifies this test as using Minio as its data source, maintaining consistency with the other connector test files.

ibis-server/tests/routers/v2/connector/test_s3_file.py (1)

80-80: LGTM! Adds appropriate data source type.

The addition of "dataSource": "s3_file" to the manifest dictionary correctly identifies this test as using Amazon S3 as its data source, which aligns with the PR objective to enhance file connector functionality.

ibis-server/tests/routers/v2/connector/test_local_file.py (1)

75-75: LGTM! Adds appropriate data source type.

The addition of "dataSource": "local_file" to the manifest dictionary correctly identifies this test as using the local file system as its data source, completing the set of data source identifiers across all connector tests.

wren-core-base/manifest-macro/src/lib.rs (1)

97-104: Looks good! New file source types added correctly.

The additions of LocalFile, S3File, GcsFile, and MinioFile variants to the DataSource enum follow the established pattern in the codebase. Each variant has the appropriate serde alias with snake_case formatting, consistent with the existing implementation.

wren-core-base/src/mdl/manifest.rs (1)

105-108: LGTM! Display implementation updated to match new enum variants.

The Display implementation for DataSource has been correctly updated to include the new file-based data source variants. The uppercase string formatting ("LOCAL_FILE", "S3_FILE", etc.) is consistent with the naming pattern used for other data sources.

✨ 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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 plan to trigger planning for file edits and PR creation.
  • @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 github-actions bot added core ibis rust Pull requests that update Rust code python Pull requests that update Python code labels Mar 26, 2025
@goldmedal goldmedal force-pushed the fix/file-datasource-extract branch from 9615d1d to 97c2809 Compare March 26, 2025 06:46
@goldmedal goldmedal marked this pull request as ready for review March 26, 2025 06:49
@goldmedal goldmedal requested a review from douenergy March 26, 2025 06:59
Copy link
Contributor

@douenergy douenergy left a comment

Choose a reason for hiding this comment

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

Thanks @goldmedal. This really save my day.

@douenergy douenergy merged commit a1d809f into Canner:main Mar 27, 2025
9 checks passed
douenergy pushed a commit to douenergy/wren-engine that referenced this pull request Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core ibis python Pull requests that update Python code rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants