mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-21 13:39:22 +01:00
fix(dashboard): remove breakdown limit in apply_dashboard_filters
(#25265)
Co-authored-by: Michael Matloka <dev@twixes.com> Co-authored-by: Michael Matloka <michael@posthog.com>
This commit is contained in:
parent
59bd3d011d
commit
dc98a00bf5
6
.github/workflows/ci-backend.yml
vendored
6
.github/workflows/ci-backend.yml
vendored
@ -147,12 +147,6 @@ jobs:
|
||||
run: |
|
||||
npm run schema:build:python && git diff --exit-code
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'PostHog/posthog-cloud-infra'
|
||||
path: 'posthog-cloud-infra'
|
||||
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
|
||||
|
||||
check-migrations:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.backend == 'true'
|
||||
|
@ -262,7 +262,7 @@ class TestTrendsDashboardFilters(BaseTest):
|
||||
assert query_runner.query.breakdownFilter is None
|
||||
assert query_runner.query.trendsFilter is None
|
||||
|
||||
def test_breakdown_limit_is_removed_when_too_large_for_dashboard(self):
|
||||
def test_breakdown_limit_is_not_removed_for_dashboard(self):
|
||||
query_runner = self._create_query_runner(
|
||||
"2020-01-09",
|
||||
"2020-01-20",
|
||||
@ -290,10 +290,7 @@ class TestTrendsDashboardFilters(BaseTest):
|
||||
|
||||
query_runner.apply_dashboard_filters(DashboardFilter())
|
||||
|
||||
assert query_runner.query.breakdownFilter == BreakdownFilter(
|
||||
breakdown="abc",
|
||||
breakdown_limit=None, # 50 series would be too many on a dashboard, reverting to default
|
||||
)
|
||||
assert query_runner.query.breakdownFilter == BreakdownFilter(breakdown="abc", breakdown_limit=50)
|
||||
|
||||
def test_compare_is_removed_for_all_time_range(self):
|
||||
query_runner = self._create_query_runner(
|
||||
|
@ -16,7 +16,7 @@ from posthog.caching.insights_api import (
|
||||
)
|
||||
from posthog.clickhouse import query_tagging
|
||||
from posthog.hogql import ast
|
||||
from posthog.hogql.constants import BREAKDOWN_VALUES_LIMIT, MAX_SELECT_RETURNED_ROWS, LimitContext
|
||||
from posthog.hogql.constants import MAX_SELECT_RETURNED_ROWS, LimitContext
|
||||
from posthog.hogql.printer import to_printed_hogql
|
||||
from posthog.hogql.query import execute_hogql_query
|
||||
from posthog.hogql.timings import HogQLTimings
|
||||
@ -979,13 +979,6 @@ class TrendsQueryRunner(QueryRunner):
|
||||
|
||||
def apply_dashboard_filters(self, dashboard_filter: DashboardFilter):
|
||||
super().apply_dashboard_filters(dashboard_filter=dashboard_filter)
|
||||
if (
|
||||
self.query.breakdownFilter
|
||||
and self.query.breakdownFilter.breakdown_limit
|
||||
and self.query.breakdownFilter.breakdown_limit > BREAKDOWN_VALUES_LIMIT
|
||||
):
|
||||
# Remove too high breakdown limit for display on the dashboard
|
||||
self.query.breakdownFilter.breakdown_limit = None
|
||||
|
||||
if (
|
||||
self.query.compareFilter is not None
|
||||
|
Loading…
Reference in New Issue
Block a user