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(trends): Added smoothing to new trends query runner #19578

Merged
merged 8 commits into from
Jan 5, 2024

Conversation

Gilbert09
Copy link
Member

Problem

Changes

  • Adds smoothing in the form of a window function on the results

How did you test this code?

  • Extended the current test suite with a test for smoothing

@Gilbert09 Gilbert09 requested a review from a team January 3, 2024 15:21
@posthog-bot
Copy link
Contributor

Hey @Gilbert09! 👋
This pull request seems to contain no description. Please add useful context, rationale, and/or any other information that will help make sense of this change now and in the distant Mars-based future.

@Gilbert09 Gilbert09 changed the title Added smoothing to new trends query runner feat(trends): Added smoothing to new trends query runner Jan 3, 2024
and self.query.trendsFilter.smoothing_intervals is not None
and self.query.trendsFilter.smoothing_intervals > 1
):
smoothing_count = ast.Alias(
Copy link
Member

Choose a reason for hiding this comment

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

I would love if we switched the vague "smoothing" terminology to "rolling average". This was a UI issue we saw with some of the users we opted into this beta feature. In the code this is not so much as UX issue, but still worth having a single accurate name (except smoothing_intervals I guess, since that's an existing schema)

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice yeah, have updated this

@Gilbert09 Gilbert09 merged commit 1fc0821 into master Jan 5, 2024
92 checks passed
@Gilbert09 Gilbert09 deleted the tom/trends-smoothing branch January 5, 2024 16:51
jacobwgillespie pushed a commit to jacobwgillespie/posthog that referenced this pull request Jan 12, 2024
* Added smoothing to new trends query runner

* Update query snapshots

* Update query snapshots

* Fixed tests

* Update query snapshots

* Updated the name to rolling average

* Fixed snaoshots

* Update query snapshots

---------

Co-authored-by: github-actions <41898282+github-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.

3 participants