## Bug description

Sentry error: https://sentry.io/organizations/posthog/issues/2588698757/events/62db81be9cbe44638988eda3dc72ad8c/?project=1899813

## Expected behavior

Don't fail

## How to reproduce

1. Create an action with a person filter (e.g. `User Signed Up (self-hosted)` on cloud)
2. Try to graph that action
3. See no results, error in backend

## Environment

- [x] PostHog Cloud
- [ ] self-hosted PostHog (ClickHouse-based), version/commit: _please provide_
- [ ] self-hosted PostHog (Postgres-based, legacy), version/commit: _please provide_

## Additional context

`ClickhouseEventQuery._determine_should_join_persons` does not resolve action type entity properties. Rather than do it there we can likely piggy-back off of `ColumnOptimizer` here.

#### *Thank you* for your bug report – we love squashing them!

ee/clickhouse/queries/event_query.py
)
                final.append(filter_query)
                params.update(filter_params)
            elif prop.type == "element":
                query, filter_params = filter_element(
                    {prop.key: prop.value}, operator=prop.operator, prepend="{}_".format(idx)
                )
                if query:
                    final.append(f" AND {query}")
                    params.update(filter_params)
            else:
                filter_query, filter_params = prop_filter_json_extract(
                    prop, idx, prepend, prop_var="properties", allow_denormalized_props=True
                )
                final.append(filter_query)
                params.update(filter_params)
        return " ".join(final), params
    def _get_cohort_subquery(self, prop) -> Tuple[str, Dict[str, Any]]:
        try:
            cohort: Cohort = Cohort.objects.get(pk=prop.value, team_id=self._team_id)
        except Cohort.DoesNotExist:
            return "0 = 11", {}  
        is_precalculated = is_precalculated_query(cohort)
        person_id_query, cohort_filter_params = (
            get_precalculated_query(cohort, 0, custom_match_field=f"{self.DISTINCT_ID_TABLE_ALIAS}.person_id")
            if is_precalculated
            else format_person_query(cohort, 0, custom_match_field=f"{self.DISTINCT_ID_TABLE_ALIAS}.person_id")
        )
        return person_id_query, cohort_filter_params