feat: add 'date.to_start_of_interval' function for truncating values to interval boundaries#5741
feat: add 'date.to_start_of_interval' function for truncating values to interval boundaries#5741sunyeongchoi wants to merge 6 commits into
Conversation
|
how about using some form of either literally or at least using the term as part of the name? |
|
@max-sixty |
yes, something like this! @prql-bot maybe you could do a survey of what is supported by other languages, around "rounding" to regular intervals |
|
Here's a survey of how other systems name their datetime truncation/rounding-to-interval functions: SQL Databases
Programming Languages / Data Tools
Key takeaways
Possible PRQL names
|
|
What do you think of |
|
sorry I missed this! I think the |
…to interval boundaries
…s and update documentation
8330dd8 to
add2138
Compare
- Updated integration snapshots for debug lineage queries to correct input and target IDs. - Adjusted SQL test cases to ensure proper formatting and expected output. - Modified documentation snapshots to reflect the correct PRQL version and expressions. - Improved comments in snapshot tests for clarity regarding pipe usage in PRQL syntax.
prql-bot
left a comment
There was a problem hiding this comment.
The function was renamed to date.floor during review (following the naming survey), but the PR title still says date.to_start_of_interval. Worth updating it before merge — PRs here land with the PR title as the squash commit message, so it would otherwise ship as a stale name in the history.
Implementation looks good — tests cover the four supported dialects and the error path for the others, and the per-dialect SQL output matches what each engine expects.
|
CI is failing on Happy to push the fix if useful — say the word. |
|
@max-sixty Thanks! As you suggested, I changed the name to |
Closes #5734
Adds a
to_start_of_intervalfunction to provide native truncating values to interval boundaries capabilities in PRQL.