-
Notifications
You must be signed in to change notification settings - Fork 173
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
use type checkers in backend-*.R
files
#1556
Conversation
Just confirmed that the |
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 going to be a very nice improvement to the user experience.
@@ -333,6 +335,7 @@ simulate_mssql <- function(version = "15.0") { | |||
second = function(x) sql_expr(DATEPART(SECOND, !!x)), | |||
|
|||
month = function(x, label = FALSE, abbr = TRUE) { | |||
check_bool(label) |
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'd be tempted to move the check for check_unsupported_arg()
next to this check.
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, interesting. I moved that check_unsupported_arg()
call to be evaluated unconditionally before realizing that the only allowed value for abbr
is FALSE
and the default is TRUE
. Bringing the check out of if (label)
would mean that month(x)
would fail by default on SQL server. I opted not to make your suggested change here and will leave this as unresolved for a day or two to give you a chance to reply before merging.
Closes #1555. As in #1554, didn't apply checks to arguments that are passed directly to
sql_*()
functions.