-
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
Add more translations for Snowflake #860
Add more translations for Snowflake #860
Conversation
Reopening after adding backend testing. Any feedback would be appreciated. |
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 for working on this! A bunch of small feedback follows.
@mgirlich could you please take a quick look too? (just to make sure I haven't forgotten anything major since I haven't worked on dbplyr in a while) |
build_sql("INTERVAL '", x, " year'") | ||
}, | ||
# https://docs.snowflake.com/en/sql-reference/functions/date_trunc.html | ||
floor_date = function(x, unit = "seconds") { |
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.
The default is plural, below is always singular. I see this is also the case for the postgres backend...
Either you simply fix the default to "seconds"
or if you want to be more user friendly you could also allow the plural version. Up to you.
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.
Good catch, maybe I'll follow up with an update to the postgres backend. Since the singular and plural versions are all supported on both Snowflake (here) and lubridate, I'm expanding the arg list to include both.
@fh-afrachioni Looks great overall. Thanks! |
Co-authored-by: Maximilian Girlich <maximilian.girlich@metoda.com>
Thanks for the review, @mgirlich; I just updated with the requested changes. Happy to address anything else! |
We've accumulated quite a few new features lately thanks to @mgirlich's hard work. So it would be nice to get a release out in the not too distant future. But no concrete plans yet. |
This request adds a number of additional translations for Snowflake backends, with the intent to translate all functions currently available for Postgres. Specifically, support is added for:
base
log10
grepl
round
paste
andpaste0
stringr
str_c
str_locate
str_detect
str_replace
andstr_replace_all
str_remove
andstr_remove_all
str_trim
andstr_squish
lubridate
day
,mday
,wday
,yday
,week
,isoweek
,month
,quarter
,isoyear
seconds
,minutes
,hours
,days
,weeks
,months
,years
floor_date
This fixes issue #935