Skip to content

docs: add today_with_timezone and min to macros #481

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 1 commit into
base: main
Choose a base branch
from

Conversation

morgan-dgk
Copy link

@morgan-dgk morgan-dgk commented Apr 14, 2025

This commit adds the today_with_timezone and min macros to the list of macros defined in declarative_component_schema.yaml. This is important because this file is used to generate the YAML reference in Airbyte's documentation.

See the fetchSchema script in main repository for details.

Summary by CodeRabbit

  • New Features
    • Introduced a macro to obtain the current date adjusted for a specified timezone.
    • Added a utility macro to determine the smallest value from a list or a set of arguments.
Copy link
Contributor

coderabbitai bot commented Apr 14, 2025

📝 Walkthrough

Walkthrough

This pull request introduces two new macro definitions in the declarative component schema. The today_with_timezone macro returns the current date as a date object in a specified IANA timezone. The min macro returns the smallest element from either an iterable or multiple arguments. Both macros include usage examples to demonstrate their functionality.

Changes

File Change Summary
airbyte_cdk/.../declarative_component_schema.yaml - Added today_with_timezone(timezone): Returns the current date for a specified IANA timezone, with examples.
- Added min(args): Returns the smallest element from provided arguments or an iterable, with examples.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant S as Declarative Schema

    U->>S: Call today_with_timezone(timezone)
    S-->>U: Return current date in specified timezone

    U->>S: Call min(args)
    S-->>U: Return smallest value from arguments
Loading

Would you like me to add any more details or perhaps simplify the diagram further? wdyt?

Possibly related PRs


📜 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 c39a233 and 2cd7048.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • 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)

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.

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

🧹 Nitpick comments (2)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (2)

4040-4048: Typo in today_with_timezone macro description.
The description currently reads:

Returns the current data in the specified timezone.

Should this be "Returns the current date in the specified timezone" to match the return type? wdyt?


4059-4066: Inconsistency in min macro description.
The macro is intended to return the smallest value, yet the description states:

Returns the largest object of a iterable, or or two or more arguments.

Would you agree to change it to "Returns the smallest object of an iterable, or two or more arguments"? Additionally, would you consider adding a return_type: Any for consistency with the other macros? wdyt?

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 836d587 and 44fb1b7.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: SDM Docker Image Build
@morgan-dgk morgan-dgk force-pushed the docs/add-missing-macros-to-component-schema branch from 44fb1b7 to fec0baa Compare April 14, 2025 08:07
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: 0

🧹 Nitpick comments (2)
airbyte_cdk/sources/declarative/declarative_component_schema.yaml (2)

4040-4048: Review on today_with_timezone Macro

This new macro is a useful addition that extends the documentation capabilities by allowing a timezone parameter. The description and examples are clear. One question: have you considered detailing how the macro handles an invalid or missing timezone value? wdyt?


4060-4066: Review on min Macro

The min macro is a great utility to have! I noticed a minor wording issue in the description: it reads “Returns the smallest object of a iterable, or or two or more arguments.” Would you consider revising this to remove the duplicate "or"—for example, “Returns the smallest object from an iterable, or from two or more arguments”—to improve clarity? wdyt?

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 44fb1b7 and fec0baa.

📒 Files selected for processing (1)
  • airbyte_cdk/sources/declarative/declarative_component_schema.yaml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: SDM Docker Image Build
@morgan-dgk morgan-dgk changed the title 📝 Add today_with_timezone and min to macros Apr 14, 2025
@marcosmarxm
Copy link
Member

@airbytehq/dev-extensibility can someone take a look at this contribution?

Copy link
Contributor

@maxi297 maxi297 left a comment

Choose a reason for hiding this comment

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

Adding the related PRs here:

This is good documentation to be added. Thanks @morgan-dgk

@morgan-dgk morgan-dgk force-pushed the docs/add-missing-macros-to-component-schema branch 2 times, most recently from cad2983 to c39a233 Compare May 1, 2025 12:57
This commit adds the today_with_timezone and min macros to the list of
macros defined in `declarative_component_schema.yaml`. This is important
because this file is used to generate the YAML reference in Airbyte's
documentation.

See the fetchSchema script in main repository for details.
@morgan-dgk morgan-dgk force-pushed the docs/add-missing-macros-to-component-schema branch from c39a233 to 2cd7048 Compare May 2, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants