-
Notifications
You must be signed in to change notification settings - Fork 2k
chore: upgrade to Python 3.12.11 #38083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a5ae229
to
9d503bc
Compare
Size Change: 0 B Total Size: 3.05 MB ℹ️ View Unchanged
|
@pauldambra and @aspicer I guess you were involved in the last Python updated. Any particular area to pay special attention to? |
i think that the django upgrades have been more painful than the python ones my guess is saml / sso / openssl is the one to watch i bet we're out of date on dependencies and type packages and that's where any changes will come from god speed! |
So far it's looking suspiciously good 🫠 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
59 files reviewed, 2 comments
|
…nd SQL modules Fixes E2E test failures where ClickHouse distributed tables reference wrong database name ('default' instead of 'posthog_test'). Root cause: Django settings imported at module level bind to values before test fixtures set environment variables. Changes: - table_engines.py: Remove default parameter binding in Distributed.__init__, evaluate cluster/database at call time - person/sql.py: Switch from posthog.settings to django.conf.settings, convert module-level SQL to functions - error_tracking/sql.py: Convert remaining module-level SQL strings to functions - Migrations and test files: Add () to call converted SQL functions Technical detail: django.conf.settings is a LazySettings proxy that defers attribute access until call time, preventing early binding.
…odule import Changed from `from posthog import settings` to `from django.conf import settings` to align with master's pattern and use Django's LazySettings proxy. Django's settings proxy defers ALL attribute lookups until access time, making it immune to import timing issues in both Python 3.11 and 3.12. This is the correct, battle-tested Django pattern that master already uses. Files updated: - posthog/models/app_metrics2/sql.py - posthog/models/person/sql.py - posthog/models/error_tracking/sql.py - posthog/clickhouse/table_engines.py - posthog/hogql/printer.py
|
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
APP_METRICS_MV_TABLE_SQL was a lambda with an f-string that evaluated settings.CLICKHOUSE_DATABASE at module import time instead of call time. This caused tests to create tables in 'default' database instead of 'posthog_test'. Convert lambda to proper function so settings are evaluated at runtime.
# Conflicts: # frontend/__snapshots__/components-playerinspector-itemevent--group-identify-event--dark.png # frontend/__snapshots__/components-playerinspector-itemevent--group-identify-event--light.png
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
# Conflicts: # posthog/async_migrations/examples/example.py # posthog/clickhouse/table_engines.py
757cabe
to
b408a46
Compare
# Conflicts: # .github/workflows/ci-backend-update-test-timing.yml # .github/workflows/ci-backend.yml # .github/workflows/ci-e2e-playwright.yml # .github/workflows/ci-python.yml # posthog/api/test/__snapshots__/test_api_docs.ambr # uv.lock
Migration SQL ChangesHey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:
|
…sion Removes IF NOT EXISTS clause from ltree extension creation that was added during merge but turned out to be unnecessary. The migration runs normally without it.
Removes snapshot files that no longer exist in master, likely due to test changes or removal.
Updates Black and Dagster tool configurations to use Python 3.12: - Black target version py311 -> py312 - Dagster python_version 3.11 -> 3.12 Ensures tool configurations match the Python 3.12 upgrade.
This reverts commit 77e8ce5.
Problem
We are on Python 3.11 still
Changes
Upgrades Python interpreter from 3.11 to 3.12.11 and updates configuration to explicitly pin the patch version (
==3.12.11
).Reasoning:
How did you test this code?
Relying on tests
Checked compatibility with various packages