Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Mar 18, 2024
1 parent e77c92a commit 06c8c83
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions posthog/hogql_queries/insights/trends/trends_query_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,13 +697,19 @@ def _is_breakdown_field_boolean(self):
):
return False

if self.query.breakdownFilter.breakdown_type == "data_warehouse":
if (
isinstance(self.query.series[0], DataWarehouseNode)
and self.query.breakdownFilter.breakdown_type == "data_warehouse"
):
series = self.query.series[0] # only one series when data warehouse is active
table_model = (
DataWarehouseTable.objects.filter(name=series.table_name, team=self.team).exclude(deleted=True).first()
)

field_type = table_model.columns[self.query.breakdownFilter.breakdown]
if not table_model:
raise ValueError(f"Table {series.table_name} not found")

field_type = dict(table_model.columns)[self.query.breakdownFilter.breakdown]

if field_type.startswith("Nullable("):
field_type = field_type.replace("Nullable(", "")[:-1]
Expand Down

0 comments on commit 06c8c83

Please sign in to comment.