Skip to content
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

Allow to invoke a calculation belong to another models #676

Merged
merged 7 commits into from
Jul 18, 2024

Conversation

goldmedal
Copy link
Contributor

@goldmedal goldmedal commented Jul 17, 2024

Description

This PR allows the calculation to be used by another model through the relationship. Consider the case in wren-modeling-rs/wren-example/examples/calculation-invoke-calculation.rs:

.column(
    ColumnBuilder::new("customer_state_cf", "varchar")
        .calculated(true)
        .expression("orders.customer_state")
        .build(),
)

We can add a calculated field in order_items to access the calculated field customer_state in orders.

Known Issue

  • Only allow one calculation in an expression currently. We will file another issue for it.

@goldmedal goldmedal marked this pull request as ready for review July 17, 2024 10:53
Copy link
Contributor

@grieve54706 grieve54706 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @goldmedal.

@grieve54706 grieve54706 merged commit 16cc917 into Canner:main Jul 18, 2024
10 checks passed
@goldmedal goldmedal deleted the feature/use-cf-in-other-model-v1 branch July 18, 2024 06:54
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.

None yet

2 participants