Skip to content

Commit

Permalink
fix(dashboard): remove breakdown limit in apply_dashboard_filters (#…
Browse files Browse the repository at this point in the history
…25265)

Co-authored-by: Michael Matloka <[email protected]>
Co-authored-by: Michael Matloka <[email protected]>
  • Loading branch information
3 people authored Oct 3, 2024
1 parent 59bd3d0 commit dc98a00
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def test_properties_list_extends_filters_group(self):
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",
Expand Down Expand Up @@ -290,10 +290,7 @@ def test_breakdown_limit_is_removed_when_too_large_for_dashboard(self):

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(
Expand Down
9 changes: 1 addition & 8 deletions posthog/hogql_queries/insights/trends/trends_query_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)
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
Expand Down Expand Up @@ -979,13 +979,6 @@ def _trends_display(self) -> TrendsDisplay:

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
Expand Down

0 comments on commit dc98a00

Please sign in to comment.