-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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 week ending and week start to grain #191
Conversation
|
@@ -285,6 +285,10 @@ def grains(self): | |||
Grain('Time Column', '{col}'), | |||
Grain('week', "date_trunc('week', CAST({col} AS DATE))"), | |||
Grain('month', "date_trunc('month', CAST({col} AS DATE))"), | |||
Grain("week_ending", "date_add('day', 5, " | |||
"date_trunc('week', date_add('day', 1, CAST({col} AS DATE))))"), | |||
Grain("week_start", "date_add('day', -1, " |
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 first argument shows as the label in the dropdown, week_start_monday
week_ending_sunday
would be more clear.
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.
@mistercrunch Makes sense. Fixed!
Add week ending and week start to grain
@mistercrunch Adding two new time grains for Presto
Both grains use Sunday to Saturday as definition of week.