Skip to content
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

[FEAT] Timestamp Truncation #2158

Merged
merged 12 commits into from
Apr 26, 2024
Merged

[FEAT] Timestamp Truncation #2158

merged 12 commits into from
Apr 26, 2024

Conversation

colin-ho
Copy link
Contributor

@colin-ho colin-ho commented Apr 20, 2024

Closes #2107

This PR adds a method to truncate the datetime column to the specified interval e.g. "1 day".

Valid time units are: 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day', 'week'.
Optional start time for truncation. If provided, truncation will be done from this start time, otherwise truncation will be done from the beginning of the epoch.

@github-actions github-actions bot added the enhancement New feature or request label Apr 20, 2024
@colin-ho colin-ho force-pushed the colin/temporal-truncation branch 2 times, most recently from e301885 to 17740ba Compare April 22, 2024 22:15
@colin-ho colin-ho marked this pull request as ready for review April 22, 2024 22:19
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 85.08%. Comparing base (1e20b2d) to head (494bd37).
Report is 2 commits behind head on main.

❗ Current head 494bd37 differs from pull request most recent head e229c0d. Consider uploading reports for the commit e229c0d to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2158      +/-   ##
==========================================
+ Coverage   85.06%   85.08%   +0.01%     
==========================================
  Files          68       68              
  Lines        7360     7376      +16     
==========================================
+ Hits         6261     6276      +15     
- Misses       1099     1100       +1     
Files Coverage Δ
daft/expressions/expressions.py 92.82% <100.00%> (+0.04%) ⬆️
daft/series.py 93.11% <83.33%> (-0.12%) ⬇️

... and 3 files with indirect coverage changes

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Apr 23, 2024
daft/expressions/expressions.py Outdated Show resolved Hide resolved
daft/expressions/expressions.py Outdated Show resolved Hide resolved
src/daft-core/src/array/ops/date.rs Outdated Show resolved Hide resolved
src/daft-core/src/array/ops/date.rs Outdated Show resolved Hide resolved
src/daft-core/src/array/ops/date.rs Outdated Show resolved Hide resolved
src/daft-core/src/array/ops/date.rs Outdated Show resolved Hide resolved
src/daft-core/src/array/ops/date.rs Outdated Show resolved Hide resolved
src/daft-core/src/array/ops/date.rs Outdated Show resolved Hide resolved
@colin-ho colin-ho requested a review from jaychia April 25, 2024 04:29
Copy link
Contributor

@jaychia jaychia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Doing the math ourselves was a good call :)

@colin-ho colin-ho merged commit f7db9a9 into main Apr 26, 2024
29 checks passed
@colin-ho colin-ho deleted the colin/temporal-truncation branch April 26, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for discretizing temporal types, providing "tumbling window groupby" functionality
2 participants