-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: more arguments for as.data.frame
#762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, some minor comments
no_optimization = FALSE, | ||
inherit_optimization = FALSE, | ||
collect_in_background = FALSE) { | ||
as_polars_df.RPolarsLazyFrame( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as_polars_df.RPolarsLazyFrame( | |
as_polars_df( |
Not necessary since the class of x
has to be RPolarsLazyFrame
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentional. I think it is worth being explicit, because if the argument to this function has an incorrect object (e.g., data.frame), an error will be generated and the bug will be noticed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand your argument. If the arg x
doesn't have the class RPolarsLazyFrame
then calling as.data.frame()
on it won't dispatch it to as.data.frame.RPolarsLazyFrame()
. So putting .RPolarsLazyFrame
inside the function is redundant because if as_polars_df()
is called, it means we know it's a RPolarsLazyFrame
. This is not very important though and I already approved the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, you are right about this place, it may be redundant since there is no possibility that anything other than RPolarsLazyFrame will be entered.
inherit_optimization = inherit_optimization, | ||
collect_in_background = collect_in_background | ||
) |> | ||
as.data.frame.RPolarsDataFrame(...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as.data.frame.RPolarsDataFrame(...) | |
as.data.frame(...) |
same
No description provided.