Skip to content

Commit

Permalink
Fix code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie committed Mar 22, 2024
1 parent 7c6cf17 commit 5795cb2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,16 +475,14 @@ export const pathsFilterToQuery = (filters: Partial<PathsFilterType>): PathsFilt
pathGroupings: filters.path_groupings,
funnelPaths: filters.funnel_paths,
funnelFilter: filters.funnel_filter,
funnelActorsQuery: filters.funnel_filter
? ({
kind: NodeKind.FunnelsActorsQuery,
source: {
funnelsFilter: funnelsFilterToQuery(filters.funnel_filter),
...filtersToQueryNode(filters.funnel_filter),
},
funnelStep: filters.funnel_filter.funnel_step,
} as FunnelsActorsQuery)
: undefined,
funnelActorsQuery:
filters.funnel_filter && Object.keys(filters.funnel_filter).length > 0
? ({
kind: NodeKind.FunnelsActorsQuery,
source: filtersToQueryNode(filters.funnel_filter),
funnelStep: filters.funnel_filter.funnel_step,
} as FunnelsActorsQuery)
: undefined,
excludeEvents: filters.exclude_events,
stepLimit: filters.step_limit,
pathReplacements: filters.path_replacements,
Expand Down
3 changes: 0 additions & 3 deletions posthog/hogql_queries/insights/paths_query_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,6 @@ def get_session_threshold_clause(self) -> ast.Expr:
interval = self.query.pathsFilter.funnelActorsQuery.source.funnelsFilter.funnelWindowInterval

Check failure on line 520 in posthog/hogql_queries/insights/paths_query_runner.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Item "None" of "FunnelsActorsQuery | None" has no attribute "source"

Check failure on line 520 in posthog/hogql_queries/insights/paths_query_runner.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Item "None" of "FunnelsFilter | Any | None" has no attribute "funnelWindowInterval"
unit = self.query.pathsFilter.funnelActorsQuery.source.funnelsFilter.funnelWindowIntervalUnit

Check failure on line 521 in posthog/hogql_queries/insights/paths_query_runner.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Item "None" of "FunnelsActorsQuery | None" has no attribute "source"

Check failure on line 521 in posthog/hogql_queries/insights/paths_query_runner.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Item "None" of "FunnelsFilter | Any | None" has no attribute "funnelWindowIntervalUnit"
interval_unit = funnel_window_interval_unit_to_sql(unit)

Check failure on line 522 in posthog/hogql_queries/insights/paths_query_runner.py

View workflow job for this annotation

GitHub Actions / Python code quality checks

Incompatible types in assignment (expression has type "Literal['DAY', 'SECOND', 'MINUTE', 'HOUR', 'WEEK', 'MONTH']", variable has type "FunnelConversionWindowTimeUnit")
# TODO: Figure out if funnelWindowDays still used
# elif self.query.pathsFilter.funnelActorsQuery.source.funnelsFilter.funnelWindowDays:
# interval = self.query.pathsFilter.funnelActorsQuery.source.funnelsFilter.funnelWindowDays

return parse_expr(
f"arraySplit(x -> if(toDateTime('2018-01-01') + toIntervalSecond(_toInt64(x.3)) < toDateTime('2018-01-01') + INTERVAL {interval} {interval_unit}, 0, 1), paths_tuple)"
Expand Down

0 comments on commit 5795cb2

Please sign in to comment.