From fcebd85b7addcfc048cd7b658c4bc9ebc944f477 Mon Sep 17 00:00:00 2001 From: Alexander Spicer Date: Wed, 2 Oct 2024 10:27:15 -0700 Subject: [PATCH] python 3.9 --- docker/clickhouse/docker-entrypoint-initdb.d/init-db.sh | 5 ++++- posthog/user_scripts/aggregate_funnel_trends.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/clickhouse/docker-entrypoint-initdb.d/init-db.sh b/docker/clickhouse/docker-entrypoint-initdb.d/init-db.sh index b38d1e0a1b729..1128061c84482 100755 --- a/docker/clickhouse/docker-entrypoint-initdb.d/init-db.sh +++ b/docker/clickhouse/docker-entrypoint-initdb.d/init-db.sh @@ -2,7 +2,10 @@ set -e apt-get update -apt-get -y install python3 +# Necessary because clickhouse runs on Ubuntu 20, which has an old glibc and an old python default +# Can remove when we upgrade clickhouse, as the new images run on Ubuntu 22 +apt-get -y install python3.9 +ln -s /usr/bin/python3.9 /usr/bin/python3 wget http://launchpadlibrarian.net/588931980/libc6_2.35-0ubuntu3_amd64.deb dpkg --auto-deconfigure -i libc6_2.35-0ubuntu3_amd64.deb cp -r /idl/* /var/lib/clickhouse/format_schemas/ diff --git a/posthog/user_scripts/aggregate_funnel_trends.py b/posthog/user_scripts/aggregate_funnel_trends.py index 2eae482d7f1cf..cde3a30928584 100755 --- a/posthog/user_scripts/aggregate_funnel_trends.py +++ b/posthog/user_scripts/aggregate_funnel_trends.py @@ -2,7 +2,7 @@ import sys from dataclasses import dataclass, replace from typing import Any, Union -import typing +from collections.abc import Sequence import json @@ -40,7 +40,7 @@ def calculate_funnel_trends_from_user_events( breakdown_attribution_type: str, funnel_order_type: str, prop_vals: list[Any], - events: typing.Sequence[tuple[float, int, Union[list[str], int, str], list[int]]], + events: Sequence[tuple[float, int, Union[list[str], int, str], list[int]]], ): default_entered_timestamp = EnteredTimestamp(0, []) # If the attribution mode is a breakdown step, set this to the integer that represents that step