From 595927e759470cf451b0b1eaaf95e787f0dea7f3 Mon Sep 17 00:00:00 2001 From: Alexander Spicer Date: Wed, 12 Jun 2024 14:22:44 -0700 Subject: [PATCH 01/34] 3.11 --- requirements-dev.in | 1 + requirements-dev.txt | 37 ++++++++++--------------------------- requirements.in | 9 ++++++--- requirements.txt | 27 ++++++++++++++------------- 4 files changed, 31 insertions(+), 43 deletions(-) diff --git a/requirements-dev.in b/requirements-dev.in index 35ad7044d22dd..ad84d43687a1c 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -53,3 +53,4 @@ flaky==3.7.0 aioresponses==0.7.6 prance==23.06.21.0 openapi-spec-validator==0.7.1 # Needed for prance as a validation backend +yarl==1.9.4 diff --git a/requirements-dev.txt b/requirements-dev.txt index ded32c00acb9f..957b7d2c20572 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,10 +1,6 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --output-file=requirements-dev.txt requirements-dev.in -# -aiohttp==3.9.3 +# This file was autogenerated by uv via the following command: +# uv pip compile requirements-dev.in -o requirements-dev.txt +aiohttp==3.9.5 # via # -c requirements.txt # aioresponses @@ -29,7 +25,6 @@ asttokens==2.4.1 async-timeout==4.0.2 # via # -c requirements.txt - # aiohttp # redis attrs==23.2.0 # via @@ -42,7 +37,7 @@ black==23.9.1 # -r requirements-dev.in # datamodel-code-generator # inline-snapshot -boto3-stubs[s3]==1.34.84 +boto3-stubs==1.34.84 # via -r requirements-dev.in botocore-stubs==1.34.84 # via boto3-stubs @@ -67,7 +62,7 @@ click==8.1.7 # inline-snapshot colorama==0.4.4 # via pytest-watch -coverage[toml]==5.5 +coverage==5.5 # via pytest-cov cryptography==37.0.2 # via @@ -96,23 +91,19 @@ docopt==0.6.2 # via pytest-watch email-validator==2.0.0.post2 # via pydantic -exceptiongroup==1.2.1 - # via - # -c requirements.txt - # pytest execnet==2.1.1 # via pytest-xdist executing==2.0.1 # via inline-snapshot faker==17.5.0 # via -r requirements-dev.in -fakeredis[lua]==2.11.0 +fakeredis==2.11.0 # via -r requirements-dev.in flaky==3.7.0 # via -r requirements-dev.in freezegun==1.2.2 # via -r requirements-dev.in -frozenlist==1.3.0 +frozenlist==1.4.1 # via # -c requirements.txt # aiohttp @@ -207,7 +198,7 @@ pycparser==2.20 # via # -c requirements.txt # cffi -pydantic[email]==2.5.3 +pydantic==2.5.3 # via # -c requirements.txt # datamodel-code-generator @@ -314,14 +305,7 @@ syrupy==4.6.0 toml==0.10.2 # via # coverage - # datamodel-code-generator # inline-snapshot -tomli==2.0.1 - # via - # black - # django-stubs - # mypy - # pytest types-awscrt==0.20.9 # via botocore-stubs types-freezegun==1.1.10 @@ -360,8 +344,6 @@ types-tzlocal==5.1.0.1 typing-extensions==4.7.1 # via # -c requirements.txt - # asgiref - # black # boto3-stubs # django-stubs # django-stubs-ext @@ -377,7 +359,8 @@ urllib3==1.26.18 # responses watchdog==2.1.8 # via pytest-watch -yarl==1.7.2 +yarl==1.9.4 # via # -c requirements.txt + # -r requirements-dev.in # aiohttp diff --git a/requirements.in b/requirements.in index 2b7efd33c6ddb..363f0e15e09e9 100644 --- a/requirements.in +++ b/requirements.in @@ -4,7 +4,7 @@ # - `uv pip compile requirements.in -o requirements.txt` # - `uv pip compile requirements-dev.in -o requirements-dev.txt` # -aiohttp>=3.9.0 +aiohttp>=3.9.5 aioboto3==12.0.0 aiokafka>=0.8 antlr4-python3-runtime==4.13.1 @@ -60,7 +60,7 @@ pyarrow==15.0.0 pydantic==2.5.3 pyjwt==2.4.0 python-dateutil>=2.8.2 -python3-saml==1.12.0 +python3-saml==1.16.0 pytz==2023.3 redis==4.5.4 retry==0.9.2 @@ -94,4 +94,7 @@ openai==1.10.0 tiktoken==0.6.0 nh3==0.2.14 hogql-parser==1.0.12 -zxcvbn==4.4.28 \ No newline at end of file +zxcvbn==4.4.28 +yarl==1.9.4 +frozenlist==1.4.1 +xmlsec==1.3.14 diff --git a/requirements.txt b/requirements.txt index 3ab55989b8abe..d5d0b1c61ec52 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ aiobotocore==2.7.0 # via # aioboto3 # s3fs -aiohttp==3.9.3 +aiohttp==3.9.5 # via # -r requirements.in # aiobotocore @@ -40,7 +40,6 @@ async-generator==1.10 # trio-websocket async-timeout==4.0.2 # via - # aiohttp # aiokafka # redis attrs==23.2.0 @@ -219,12 +218,11 @@ drf-spectacular==0.27.1 # via -r requirements.in et-xmlfile==1.1.0 # via openpyxl -exceptiongroup==1.2.1 - # via anyio filelock==3.12.0 # via snowflake-connector-python -frozenlist==1.3.0 +frozenlist==1.4.1 # via + # -r requirements.in # aiohttp # aiosignal fsspec==2023.10.0 @@ -261,6 +259,8 @@ googleapis-common-protos==1.60.0 # via # google-api-core # grpcio-status +greenlet==3.0.3 + # via sqlalchemy grpcio==1.57.0 # via # google-api-core @@ -461,14 +461,13 @@ python-dateutil==2.8.2 # pandas # pendulum # posthoganalytics - # temporalio python-dotenv==0.21.0 # via webdriver-manager python-statsd==2.1.0 # via django-statsd python3-openid==3.1.0 # via social-auth-core -python3-saml==1.12.0 +python3-saml==1.16.0 # via -r requirements.in pytz==2023.3 # via @@ -635,8 +634,6 @@ types-setuptools==69.0.0.0 # via requirements-parser typing-extensions==4.7.1 # via - # anyio - # asgiref # dlt # openai # psycopg @@ -685,9 +682,13 @@ wrapt==1.15.0 # via aiobotocore wsproto==1.1.0 # via trio-websocket -xmlsec==1.3.13 - # via python3-saml -yarl==1.7.2 - # via aiohttp +xmlsec==1.3.14 + # via + # -r requirements.in + # python3-saml +yarl==1.9.4 + # via + # -r requirements.in + # aiohttp zxcvbn==4.4.28 # via -r requirements.in From 41cf6456439c6bc3348308c103fa4f88954b5f09 Mon Sep 17 00:00:00 2001 From: Alexander Spicer Date: Wed, 12 Jun 2024 14:56:30 -0700 Subject: [PATCH 02/34] push --- posthog/hogql/ast.py | 2 +- requirements.in | 7 +++---- requirements.txt | 11 +++-------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/posthog/hogql/ast.py b/posthog/hogql/ast.py index d9e71e34e4cac..9d1bca064a54b 100644 --- a/posthog/hogql/ast.py +++ b/posthog/hogql/ast.py @@ -386,7 +386,7 @@ def print_type(self) -> str: @dataclass(kw_only=True) class ArrayType(ConstantType): data_type: ConstantDataType = field(default="array", init=False) - item_type: ConstantType = UnknownType() + item_type: ConstantType = field(default_factory=UnknownType) def print_type(self) -> str: return "Array" diff --git a/requirements.in b/requirements.in index 363f0e15e09e9..e3825aecbc775 100644 --- a/requirements.in +++ b/requirements.in @@ -4,7 +4,7 @@ # - `uv pip compile requirements.in -o requirements.txt` # - `uv pip compile requirements-dev.in -o requirements-dev.txt` # -aiohttp>=3.9.5 +aiohttp>=3.9.0 aioboto3==12.0.0 aiokafka>=0.8 antlr4-python3-runtime==4.13.1 @@ -60,7 +60,7 @@ pyarrow==15.0.0 pydantic==2.5.3 pyjwt==2.4.0 python-dateutil>=2.8.2 -python3-saml==1.16.0 +python3-saml==1.12.0 pytz==2023.3 redis==4.5.4 retry==0.9.2 @@ -95,6 +95,5 @@ tiktoken==0.6.0 nh3==0.2.14 hogql-parser==1.0.12 zxcvbn==4.4.28 -yarl==1.9.4 -frozenlist==1.4.1 xmlsec==1.3.14 +lxml==5.2.2 diff --git a/requirements.txt b/requirements.txt index d5d0b1c61ec52..8620f56611503 100644 --- a/requirements.txt +++ b/requirements.txt @@ -222,7 +222,6 @@ filelock==3.12.0 # via snowflake-connector-python frozenlist==1.4.1 # via - # -r requirements.in # aiohttp # aiosignal fsspec==2023.10.0 @@ -467,7 +466,7 @@ python-statsd==2.1.0 # via django-statsd python3-openid==3.1.0 # via social-auth-core -python3-saml==1.16.0 +python3-saml==1.12.0 # via -r requirements.in pytz==2023.3 # via @@ -683,12 +682,8 @@ wrapt==1.15.0 wsproto==1.1.0 # via trio-websocket xmlsec==1.3.14 - # via - # -r requirements.in - # python3-saml + # via python3-saml yarl==1.9.4 - # via - # -r requirements.in - # aiohttp + # via aiohttp zxcvbn==4.4.28 # via -r requirements.in From 3b21fbcc1e59cc6edfebb9bff79002786cccd81d Mon Sep 17 00:00:00 2001 From: Alexander Spicer Date: Wed, 12 Jun 2024 15:08:08 -0700 Subject: [PATCH 03/34] 3.11 --- .devcontainer/Dockerfile | 2 +- .github/actions/run-backend-tests/action.yml | 2 +- .github/workflows/benchmark.yml | 2 +- .../ci-backend-update-test-timing.yml | 2 +- .github/workflows/ci-backend.yml | 10 +- .github/workflows/ci-hog.yml | 2 +- .github/workflows/ci-plugin-server.yml | 4 +- .run/Celery Beat.run.xml | 3 +- .run/Celery Threads.run.xml | 3 +- mypy.ini | 2 +- production.Dockerfile | 102 +----------------- 11 files changed, 19 insertions(+), 115 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a18238c43fc87..7d82e9ab4786c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -7,7 +7,7 @@ # experience as rich as possible. Perhaps later down the line it might be worth # rolling our own # -FROM mcr.microsoft.com/vscode/devcontainers/python:3.10-bullseye +FROM mcr.microsoft.com/vscode/devcontainers/python:3.11-bullseye # Make sure all exit codes on pipes cause failures SHELL ["/bin/bash", "-o", "pipefail", "-c"] diff --git a/.github/actions/run-backend-tests/action.yml b/.github/actions/run-backend-tests/action.yml index c1d465166161b..39cba842f237b 100644 --- a/.github/actions/run-backend-tests/action.yml +++ b/.github/actions/run-backend-tests/action.yml @@ -6,7 +6,7 @@ name: Run Django tests inputs: python-version: required: true - description: Python version, e.g. 3.10.10 + description: Python version, e.g. 3.11.9 clickhouse-server-image: required: true description: ClickHouse server image tag, e.g. clickhouse/clickhouse-server:latest diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index bd50811fae662..9478b7d2f8c80 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -54,7 +54,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.10.10 + python-version: 3.11.9 cache: 'pip' cache-dependency-path: '**/requirements*.txt' token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/ci-backend-update-test-timing.yml b/.github/workflows/ci-backend-update-test-timing.yml index a2082f6b98955..01ad7d33ce305 100644 --- a/.github/workflows/ci-backend-update-test-timing.yml +++ b/.github/workflows/ci-backend-update-test-timing.yml @@ -28,7 +28,7 @@ jobs: concurrency: 1 group: 1 token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} - python-version: '3.10.10' + python-version: '3.11.9' clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.5.81-alpine' segment: 'FOSS' person-on-events: false diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml index 828594de9eba8..eec9d25f12003 100644 --- a/.github/workflows/ci-backend.yml +++ b/.github/workflows/ci-backend.yml @@ -108,7 +108,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.10.10 + python-version: 3.11.9 cache: 'pip' cache-dependency-path: '**/requirements*.txt' token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} @@ -163,7 +163,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.10.10 + python-version: 3.11.9 cache: 'pip' cache-dependency-path: '**/requirements*.txt' token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} @@ -231,7 +231,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10.10'] + python-version: ['3.11.9'] clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.5.81-alpine'] segment: ['Core'] person-on-events: [false, true] @@ -242,7 +242,7 @@ jobs: - segment: 'Temporal' person-on-events: false clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.5.81-alpine' - python-version: '3.10.10' + python-version: '3.11.9' concurrency: 1 group: 1 @@ -330,7 +330,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.10.10 + python-version: 3.11.9 cache: 'pip' cache-dependency-path: '**/requirements*.txt' token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/ci-hog.yml b/.github/workflows/ci-hog.yml index 7e6a5caf94005..eade4908f5a4c 100644 --- a/.github/workflows/ci-hog.yml +++ b/.github/workflows/ci-hog.yml @@ -62,7 +62,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.10.10 + python-version: 3.11.9 cache: 'pip' cache-dependency-path: '**/requirements*.txt' token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/ci-plugin-server.yml b/.github/workflows/ci-plugin-server.yml index dac67b705b6a5..b4d6cb0a17f36 100644 --- a/.github/workflows/ci-plugin-server.yml +++ b/.github/workflows/ci-plugin-server.yml @@ -115,7 +115,7 @@ jobs: if: needs.changes.outputs.plugin-server == 'true' uses: actions/setup-python@v5 with: - python-version: 3.10.10 + python-version: 3.11.9 cache: 'pip' cache-dependency-path: '**/requirements*.txt' token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} @@ -207,7 +207,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.10.10 + python-version: 3.11.9 cache: 'pip' cache-dependency-path: '**/requirements*.txt' token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} diff --git a/.run/Celery Beat.run.xml b/.run/Celery Beat.run.xml index 86d7e07d05ec9..aa03c3deb055c 100644 --- a/.run/Celery Beat.run.xml +++ b/.run/Celery Beat.run.xml @@ -14,8 +14,9 @@