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: support pre-binned timeUnit #8971

Merged
merged 11 commits into from
Jun 29, 2023
Merged

feat: support pre-binned timeUnit #8971

merged 11 commits into from
Jun 29, 2023

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented Jun 27, 2023

Fix #8969

This allows us to use timeUnit without adding unnecessary timeUnit to re-bin the data, if the data has already been binned.

  • handle binned utc
  • bandPosition
  • Add documentation
  • Add unit tests

@kanitw kanitw requested review from domoritz and yhoonkim June 27, 2023 05:40
@kanitw kanitw marked this pull request as ready for review June 27, 2023 05:41
@kanitw kanitw changed the title refactor: extract getDateTimePartAndStep from durationExpr feat: support pre-binned timeUnit Jun 27, 2023
@kanitw kanitw requested a review from fandu-db June 27, 2023 16:29
@kanitw kanitw marked this pull request as draft June 27, 2023 16:30
@kanitw kanitw force-pushed the kw/8969-binned-timeunit branch 3 times, most recently from 4e318f5 to aa264b4 Compare June 28, 2023 04:18
@kanitw kanitw marked this pull request as ready for review June 28, 2023 04:19
@kanitw kanitw force-pushed the kw/8969-binned-timeunit branch 2 times, most recently from f4c4c59 to fd898bb Compare June 28, 2023 19:58
Copy link
Contributor

@yhoonkim yhoonkim left a comment

Choose a reason for hiding this comment

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

Just made a minor comment. It looks good to me.

By default, all time units represent date time using local time. To use UTC time, you can add the `utc` prefix (e.g., `"utcyear"`, `"utcyearmonth"`).
- By default, all time units represent date time using local time.
- To use UTC time, you can add the `utc` prefix (e.g., `"utcyear"`, `"utcyearmonth"`).
- For timeUnit in encoding, you can also add `"binned"` prefix (e.g., `"binnedyearmonth"` or `"binnedutcyearmonth"`) for Chronological time unit (i.e., units that are truncated date time)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what Chronological time unit means here. Can we just say truncated (or binned) date time directly?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's another semantic-based way to explain date trunc (which focus on action being done on the date object, rather than the semantics).

It's a term that Jeff uses in Vega doc. https://vega.github.io/vega/docs/transforms/timeunit/

I added a bit more explanation so I hope it makes more sense now.

@kanitw kanitw enabled auto-merge (squash) June 29, 2023 21:19
@kanitw kanitw merged commit dac5c19 into main Jun 29, 2023
@kanitw kanitw deleted the kw/8969-binned-timeunit branch June 29, 2023 21:26
BradyJ27 pushed a commit to BradyJ27/vega-lite that referenced this pull request Oct 19, 2023
Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
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.

Support prebinned timeUnit to avoid unnecessary computations
2 participants