Skip to content

feat(low-code): camel_case_to_snake_case macros #617

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

darynaishchenko
Copy link
Contributor

@darynaishchenko darynaishchenko commented Jun 27, 2025

Add camel_case_to_snake_case to transform values from CamelCase to snake_case
Needed for bing-ads custom reports to transform custom report names.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added support for converting CamelCase strings to snake_case in interpolation macros.
  • Tests

    • Introduced tests to verify correct conversion of CamelCase and mixed-case strings to snake_case.

@darynaishchenko darynaishchenko self-assigned this Jun 27, 2025
@github-actions github-actions bot added the enhancement New feature or request label Jun 27, 2025
@darynaishchenko
Copy link
Contributor Author

darynaishchenko commented Jun 27, 2025

/autofix

Auto-Fix Job Info

This job attempts to auto-fix any linting or formating issues. If any fixes are made,
those changes will be automatically committed and pushed back to the PR.

Note: This job can only be run by maintainers. On PRs from forks, this command requires
that the PR author has enabled the Allow edits from maintainers option.

PR auto-fix job started... Check job output.

✅ Changes applied successfully.

@darynaishchenko darynaishchenko changed the title feat(low-code) camel_cate_to_snake_case macros feat(low-code): camel_cate_to_snake_case macros Jun 27, 2025
Copy link
Contributor

coderabbitai bot commented Jun 27, 2025

📝 Walkthrough

Walkthrough

A new macro function, camel_case_to_snake_case, has been introduced to convert CamelCase strings to snake_case. This macro is now available for interpolation. Corresponding parameterized unit tests have been added to verify its correctness with various input scenarios.

Changes

File(s) Change Summary
airbyte_cdk/sources/declarative/interpolation/macros.py Added camel_case_to_snake_case macro function, registered it for interpolation use.
unit_tests/sources/declarative/interpolation/test_macros.py Added parameterized tests to validate camel_case_to_snake_case macro behavior.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MacroSystem
    participant camel_case_to_snake_case

    User->>MacroSystem: Request interpolation with camel case input
    MacroSystem->>camel_case_to_snake_case: Call macro with input string
    camel_case_to_snake_case-->>MacroSystem: Return snake_case string
    MacroSystem-->>User: Provide interpolated result
Loading

Would you like to see additional test scenarios for edge cases in the macro, such as handling numbers or special characters, 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 cd9612e and 69bf8f8.

📒 Files selected for processing (2)
  • airbyte_cdk/sources/declarative/interpolation/macros.py (3 hunks)
  • unit_tests/sources/declarative/interpolation/test_macros.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • airbyte_cdk/sources/declarative/interpolation/macros.py
  • unit_tests/sources/declarative/interpolation/test_macros.py
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Check: source-shopify
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
✨ 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.

Copy link

github-actions bot commented Jun 27, 2025

PyTest Results (Fast)

3 681 tests  +5   3 670 ✅ +5   6m 20s ⏱️ -3s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 69bf8f8. ± Comparison against base commit 0b4195b.

♻️ This comment has been updated with latest results.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0b4195b and cd9612e.

📒 Files selected for processing (2)
  • airbyte_cdk/sources/declarative/interpolation/macros.py (3 hunks)
  • unit_tests/sources/declarative/interpolation/test_macros.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 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.
Learnt from: aaronsteers
PR: airbytehq/airbyte-python-cdk#13
File: airbyte_cdk/connector.py:99-99
Timestamp: 2024-11-10T04:50:11.914Z
Learning: When a PR's goal is to run the autoformat task from `ruff`, avoid suggesting code changes beyond formatting to prevent potential negative side effects.
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Check: source-amplitude
  • GitHub Check: Check: source-hardcoded-records
  • GitHub Check: Check: source-intercom
  • GitHub Check: Check: source-shopify
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: SDM Docker Image Build
🔇 Additional comments (2)
airbyte_cdk/sources/declarative/interpolation/macros.py (2)

7-7: LGTM!

The re import is correctly placed and necessary for the new macro function.


214-214: Update the reference after fixing the function name.

This addition to the macros list is correct! Just remember to update the function name reference here too when you fix the typo above, wdyt?

-    camel_cate_to_snake_case,
+    camel_case_to_snake_case,

Copy link

github-actions bot commented Jun 27, 2025

PyTest Results (Full)

3 684 tests  +5   3 673 ✅ +5   18m 0s ⏱️ -3s
    1 suites ±0      11 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 69bf8f8. ± Comparison against base commit 0b4195b.

♻️ This comment has been updated with latest results.

@darynaishchenko darynaishchenko changed the title feat(low-code): camel_cate_to_snake_case macros feat(low-code): camel_case_to_snake_case macros Jun 27, 2025
@darynaishchenko
Copy link
Contributor Author

darynaishchenko commented Jun 27, 2025

/autofix

Auto-Fix Job Info

This job attempts to auto-fix any linting or formating issues. If any fixes are made,
those changes will be automatically committed and pushed back to the PR.

Note: This job can only be run by maintainers. On PRs from forks, this command requires
that the PR author has enabled the Allow edits from maintainers option.

PR auto-fix job started... Check job output.

✅ Changes applied successfully.

Copy link
Contributor

@aldogonzalez8 aldogonzalez8 left a comment

Choose a reason for hiding this comment

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

APPROVED

Copy link
Collaborator

@ChristoGrab ChristoGrab left a comment

Choose a reason for hiding this comment

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

🚢

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.

3 participants