## Is your feature request related to a problem?

There's only 2 files where we use pandas, but pandas is 49MB and numpy is another 86MB, slowing down builds massively.

## Describe the solution you'd like

Replace pandas with a pure SQL/Python solution in
- posthog/queries/trends.py
- posthog/queries/sessions.py

Both of those have equivalent examples in Clickhouse (ee/clickhouse) that don't use Pandas.

## Describe alternatives you've considered

Continue using Pandas and clogging builds

## Additional context



#### *Thank you* for your feature request – we love each and every one!

posthog/utils.py
try:
        return get_celery_heartbeat() != "offline"
    except BaseException:
        return False
def is_plugin_server_alive() -> bool:
    try:
        ping = get_client().get("@posthog-plugin-server/ping")
        return ping and parser.isoparse(ping) > timezone.now() - relativedelta(seconds=30)
    except BaseException:
        return False
def get_redis_info() -> Mapping[str, Any]:
    return get_client().info()
def get_redis_queue_depth() -> int:
    return get_client().llen("celery")
def queryset_to_named_query(qs: QuerySet, prepend: str = "") -> Tuple[str, dict]:
    raw, params = qs.query.sql_with_params()
    arg_count = 0
    counter = count(arg_count)
    new_string = re.sub(r"%s", lambda _: f"%({prepend}_arg_{str(next(counter))})s", raw)
    named_params = {}
    for idx, param in enumerate(params):
        named_params.update({f"{prepend}_arg_{idx}": param})
    return new_string, named_params
def flatten(l: Union[List, Tuple]) -> Generator:
    for el in l:
        if isinstance(el, list):
            yield from flatten(el)
        else:
            yield el