-
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
Implement $str$to_date()
, $str$to_time()
, $str$to_datetime()
#558
Conversation
Merge branch 'main' into to-date # Conflicts: # R/extendr-wrappers.R
$str$to_date()
and $str$to_datetime()
$str$to_date()
, $str$to_time()
, $str$to_datetime()
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.
Looks good, thanks!
Just a minor comment.
ExprStr_to_date = function(format = NULL, strict = TRUE, exact = TRUE, cache = TRUE) { | ||
.pr$Expr$str_to_date(self, format, strict, exact, cache) |> | ||
unwrap("in $str$to_date():") | ||
} |
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.
Probably applicable to other functions as well, but such functions may be better off using ...
to enforce named arguments.
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.
but then you lose the description of each param in the docs, no? In any case, if that concerns several other functions it can be done in another PR so I'm merging this
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.
but then you lose the description of each param in the docs, no?
I'm sorry, but I don't understand. Here's what I mean:
ExprStr_to_date = function(..., format = NULL, strict = TRUE, exact = TRUE, cache = TRUE)
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.
Oh right, could be added later but that could also apply to basically all functions that have several args
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.
Agree.
I think it's safer to do this for most of the functions that have a lot of arguments.
They were already there but not available through the namespace
$str
because they were only used in$str$strptime()
Also updated the arguments because some were deprecated/removed upstream