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

refactor: several updates to dsl.rs #1093

Merged
merged 2 commits into from
May 15, 2024
Merged

refactor: several updates to dsl.rs #1093

merged 2 commits into from
May 15, 2024

Conversation

etiennebacher
Copy link
Collaborator

No changes visible by user (except for error messages):

  • Replace r_result_list by RResult<RPolarsExpr>
  • Remove calls to .map() when they are unnecessary
  • Update the message when a value is not accepted.

Old:

library(polars)
options(polars.do_not_repeat_call = TRUE)

df = pl$DataFrame(
  foo = 1:3,
  bar = c(6, 7, 8),
  ham = c("a", "b", "c")
)

other_df = pl$DataFrame(
  apple = c("x", "y", "z"),
  ham = c("a", "b", "d")
)

df$join(other_df, on = "ham", how = "foobar")
#> Error: Execution halted with the following contexts
#>    0: In R: in $join():
#>    1: The argument [how] caused an error
#>    2: Got value [JoinType choice ('foobar') must be one of 'cross', 'inner', 'left', 'outer', 'semi', 'anti']

New:

Error: Execution halted with the following contexts
   0: In R: in $join():
   1: The argument [how] caused an error
   2: Invalid choice: JoinType ('foobar') must be one of 'cross', 'inner', 'left', 'outer', 'semi', 'anti'

@etiennebacher etiennebacher requested a review from eitsupi May 15, 2024 15:36
Copy link
Collaborator

@eitsupi eitsupi left a comment

Choose a reason for hiding this comment

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

Thanks!

@etiennebacher etiennebacher merged commit 14dd377 into main May 15, 2024
29 of 35 checks passed
@etiennebacher etiennebacher deleted the rust-dsl-refactor branch May 15, 2024 17:12
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.

2 participants