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(date): add location support to date.truncate function #4675

Merged
merged 5 commits into from
Apr 22, 2022

Conversation

2opremio
Copy link
Contributor

@2opremio 2opremio commented Apr 17, 2022

  1. Added support for location option to date.truncate by replacing the use of execute.Window by interval.Window
  2. Go & acceptance test added in date package

Inspired by #4327

fixes #4656

Done checklist

  • docs/SPEC.md updated
  • Test cases written

@2opremio 2opremio requested review from a team as code owners April 17, 2022 20:24
@2opremio 2opremio requested review from Marwes and sunbryely-influxdata and removed request for a team April 17, 2022 20:24
@2opremio
Copy link
Contributor Author

CC @skartikey

@2opremio 2opremio force-pushed the 4656-truncate-location-support branch from 5cf4ff7 to 5c3affa Compare April 17, 2022 21:28
stdlib/date/date.go Show resolved Hide resolved
if err != nil {
return nil, err
}
b := w.GetLatestBounds(t)
Copy link
Contributor

Choose a reason for hiding this comment

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

Strange how we have two "Window" types and one supports GetEarliestBounds and the other only supports GetLatestBounds. Since the windows do not overlap they ought to return the same result either way at least (nothing to change here).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed! BTW execute.Window seems to only be used by interpolate. So I think may be able to get rid of it and completely replace it by interval.Window.

stdlib/date/truncate_duration_test.flux Outdated Show resolved Hide resolved
stdlib/date/truncate_duration_test.flux Outdated Show resolved Hide resolved
@2opremio
Copy link
Contributor Author

@Marwes PTAL!

@2opremio
Copy link
Contributor Author

@Marwes friendly ping

@Marwes Marwes merged commit fdf2715 into influxdata:master Apr 22, 2022
@2opremio 2opremio deleted the 4656-truncate-location-support branch April 22, 2022 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Location support for date.truncate function
2 participants