Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore: update ruff to 0.15.16 (#62780)

Raúl Negrón-Otero74a4764ab197
diff --git a/common/hogvm/python/stl/__init__.py b/common/hogvm/python/stl/__init__.py
index 9ffa2162fc3b..7c0f94f8c06c 100644
--- a/common/hogvm/python/stl/__init__.py
+++ b/common/hogvm/python/stl/__init__.py
@@ -968,9 +968,9 @@ STL: dict[str, STLFunction] = {
maxArgs=None,
),
"match": STLFunction(
- fn=lambda args, team, stdout, timeout: False
- if args[1] is None or args[0] is None
- else bool(re.search(re.compile(args[1]), args[0])),
+ fn=lambda args, team, stdout, timeout: (
+ False if args[1] is None or args[0] is None else bool(re.search(re.compile(args[1]), args[0]))
+ ),
minArgs=2,
maxArgs=2,
),
@@ -1018,16 +1018,18 @@ STL: dict[str, STLFunction] = {
fn=lambda args, team, stdout, timeout: args[0].replace(args[1], args[2]), minArgs=3, maxArgs=3
),
"position": STLFunction(
- fn=lambda args, team, stdout, timeout: (args[0].index(str(args[1])) + 1)
- if isinstance(args[0], str) and str(args[1]) in args[0]
- else 0,
+ fn=lambda args, team, stdout, timeout: (
+ (args[0].index(str(args[1])) + 1) if isinstance(args[0], str) and str(args[1]) in args[0] else 0
+ ),
minArgs=2,
maxArgs=2,
),
"positionCaseInsensitive": STLFunction(
- fn=lambda args, team, stdout, timeout: (args[0].lower().index(str(args[1]).lower()) + 1)
- if isinstance(args[0], str) and str(args[1]).lower() in args[0].lower()
- else 0,
+ fn=lambda args, team, stdout, timeout: (
+ (args[0].lower().index(str(args[1]).lower()) + 1)
+ if isinstance(args[0], str) and str(args[1]).lower() in args[0].lower()
+ else 0
+ ),
minArgs=2,
maxArgs=2,
),
@@ -1063,9 +1065,9 @@ STL: dict[str, STLFunction] = {
"keys": STLFunction(fn=keys, minArgs=1, maxArgs=1),
"values": STLFunction(fn=values, minArgs=1, maxArgs=1),
"indexOf": STLFunction(
- fn=lambda args, team, stdout, timeout: (args[0].index(args[1]) + 1)
- if isinstance(args[0], list) and args[1] in args[0]
- else 0,
+ fn=lambda args, team, stdout, timeout: (
+ (args[0].index(args[1]) + 1) if isinstance(args[0], list) and args[1] in args[0] else 0
+ ),
minArgs=2,
maxArgs=2,
),
diff --git a/ee/api/agentic_provisioning/test/test_signature.py b/ee/api/agentic_provisioning/test/test_signature.py
index 0a253a56fdc4..1a283e59ca31 100644
--- a/ee/api/agentic_provisioning/test/test_signature.py
+++ b/ee/api/agentic_provisioning/test/test_signature.py
@@ -174,8 +174,9 @@ class TestVerifySignatureAfterDRFParsing(TestCase):
[
(
"no_signature_matches",
- lambda body,
- ts: f"t={ts},v1={compute_signature('wrong_a', ts, body)},v1={compute_signature('wrong_b', ts, body)}",
+ lambda body, ts: (
+ f"t={ts},v1={compute_signature('wrong_a', ts, body)},v1={compute_signature('wrong_b', ts, body)}"
+ ),
),
("stale_timestamp", lambda body, ts: f"t={ts - 301},v1={compute_signature(HMAC_SECRET, ts - 301, body)}"),
("wrong_scheme_only", lambda body, ts: f"t={ts},v0={compute_signature(HMAC_SECRET, ts, body)}"),
diff --git a/ee/clickhouse/queries/test/test_column_optimizer.py b/ee/clickhouse/queries/test/test_column_optimizer.py
index d6882ffaa549..5d1e61461374 100644
--- a/ee/clickhouse/queries/test/test_column_optimizer.py
+++ b/ee/clickhouse/queries/test/test_column_optimizer.py
@@ -35,9 +35,9 @@ class TestColumnOptimizer(ClickhouseTestMixin, APIBaseTest):
cleanup_materialized_columns()
def test_properties_used_in_filter(self):
- properties_used_in_filter = lambda filter: EnterpriseColumnOptimizer(
- filter, self.team.id
- ).properties_used_in_filter
+ properties_used_in_filter = lambda filter: (
+ EnterpriseColumnOptimizer(filter, self.team.id).properties_used_in_filter
+ )
self.assertEqual(properties_used_in_filter(BASE_FILTER), {})
self.assertEqual(
diff --git a/ee/hogai/chat_agent/schema_generator/test/test_nodes.py b/ee/hogai/chat_agent/schema_generator/test/test_nodes.py
index 60a17aa2c52b..3dd03c84ab6a 100644
--- a/ee/hogai/chat_agent/schema_generator/test/test_nodes.py
+++ b/ee/hogai/chat_agent/schema_generator/test/test_nodes.py
@@ -361,7 +361,9 @@ class TestSchemaGeneratorNode(BaseTest):
DummyGeneratorNode,
"_model",
return_value=RunnableLambda(
- lambda _: """\n\n{\"query\":{\"kind\":\"RetentionQuery\",\"dateRange\":{\"date_from\":\"2024-01-01\",\"date_to\":\"2024-12-31\"},\"retentionFilter\":{\"period\":\"Week\",\"totalIntervals\":11,\"targetEntity\":{\"name\":\"Application Opened\",\"type\":\"events\"},\"returningEntity\":{\"name\":\"Application Opened\",\"type\":\"events\"}},\"filterTestAccounts\":false}\t \t\t \t\t \t \t"""
+ lambda _: (
+ """\n\n{\"query\":{\"kind\":\"RetentionQuery\",\"dateRange\":{\"date_from\":\"2024-01-01\",\"date_to\":\"2024-12-31\"},\"retentionFilter\":{\"period\":\"Week\",\"totalIntervals\":11,\"targetEntity\":{\"name\":\"Application Opened\",\"type\":\"events\"},\"returningEntity\":{\"name\":\"Application Opened\",\"type\":\"events\"}},\"filterTestAccounts\":false}\t \t\t \t\t \t \t"""
+ )
),
):
new_state = await node(AssistantState(messages=[HumanMessage(content="Text")]), {})
diff --git a/posthog/admin/test_team_admin.py b/posthog/admin/test_team_admin.py
index b87c25f51a5b..9d59d03611b5 100644
--- a/posthog/admin/test_team_admin.py
+++ b/posthog/admin/test_team_admin.py
@@ -34,9 +34,9 @@ class TestTeamAdminSetApiTokenView(BaseTest):
reverse_patcher = patch(
"posthog.admin.admins.team_admin.reverse",
- side_effect=lambda name, args=None, kwargs=None: self.team_change_url
- if name == "admin:posthog_team_change"
- else self.set_api_token_url,
+ side_effect=lambda name, args=None, kwargs=None: (
+ self.team_change_url if name == "admin:posthog_team_change" else self.set_api_token_url
+ ),
)
reverse_patcher.start()
self.addCleanup(reverse_patcher.stop)
diff --git a/posthog/api/test/test_user.py b/posthog/api/test/test_user.py
index 462019081ca5..61c8ffabec17 100644
--- a/posthog/api/test/test_user.py
+++ b/posthog/api/test/test_user.py
@@ -812,9 +812,9 @@ class TestUserAPI(APIBaseTest):
with patch(
"posthog.models.organization_domain.OrganizationDomainManager.get_sso_enforcement_for_email_address",
- side_effect=lambda email, organization=None: "google-oauth2"
- if email.split("@")[-1] in ("example.com", "example.org")
- else None,
+ side_effect=lambda email, organization=None: (
+ "google-oauth2" if email.split("@")[-1] in ("example.com", "example.org") else None
+ ),
):
with self.is_cloud(True):
response = self.client.patch("/api/users/@me/", {"email": "[email protected]"})
@@ -849,9 +849,9 @@ class TestUserAPI(APIBaseTest):
with patch(
"posthog.models.organization_domain.OrganizationDomainManager.get_sso_enforcement_for_email_address",
- side_effect=lambda email, organization=None: "google-oauth2"
- if email.split("@")[-1] in ("example.com", "example.net")
- else None,
+ side_effect=lambda email, organization=None: (
+ "google-oauth2" if email.split("@")[-1] in ("example.com", "example.net") else None
+ ),
):
with self.is_cloud(True):
response = self.client.patch("/api/users/@me/", {"email": "[email protected]"})
diff --git a/posthog/clickhouse/client/test/test_limit.py b/posthog/clickhouse/client/test/test_limit.py
index 93bb4cbc609d..8077ffdfc955 100644
--- a/posthog/clickhouse/client/test/test_limit.py
+++ b/posthog/clickhouse/client/test/test_limit.py
@@ -14,7 +14,7 @@ class TestRateLimit(BaseTest):
super().setUp()
self.limit = RateLimit(
max_concurrency=1,
- applicable=lambda *args, **kwargs: (kwargs.get("is_api") if "is_api" in kwargs else args[0]),
+ applicable=lambda *args, **kwargs: kwargs.get("is_api") if "is_api" in kwargs else args[0],
limit_name="api_per_team",
get_task_name=lambda *args, **kwargs: f"rate-limit-test-task:{kwargs.get('team_id') or args[1]}",
get_task_key=lambda *args, **kwargs: f"limit:rate-limit-test-task:{kwargs.get('team_id') or args[1]}",
diff --git a/posthog/clickhouse/logs/logs32.py b/posthog/clickhouse/logs/logs32.py
index 6266f36d0424..0a4dde2abb42 100644
--- a/posthog/clickhouse/logs/logs32.py
+++ b/posthog/clickhouse/logs/logs32.py
@@ -6,8 +6,8 @@ from .log_attributes import TABLE_NAME as LOG_ATTRIBUTES_TABLE_NAME
TABLE_NAME = "logs32"
-TTL = (
- lambda: "TTL timestamp + toIntervalHour(25) TO DISK 's3'" if settings.CLICKHOUSE_LOGS_ENABLE_STORAGE_POLICY else ""
+TTL = lambda: (
+ "TTL timestamp + toIntervalHour(25) TO DISK 's3'" if settings.CLICKHOUSE_LOGS_ENABLE_STORAGE_POLICY else ""
)
STORAGE_POLICY = lambda: "tiered" if settings.CLICKHOUSE_LOGS_ENABLE_STORAGE_POLICY else "default"
diff --git a/posthog/clickhouse/migrations/0063_drop_partition_stats.py b/posthog/clickhouse/migrations/0063_drop_partition_stats.py
index b622386b17ca..30aedccc6a1b 100644
--- a/posthog/clickhouse/migrations/0063_drop_partition_stats.py
+++ b/posthog/clickhouse/migrations/0063_drop_partition_stats.py
@@ -6,12 +6,12 @@ from posthog.kafka_client.topics import (
)
from posthog.settings import CLICKHOUSE_CLUSTER, CLICKHOUSE_DATABASE
-DROP_EVENTS_PLUGIN_INGESTION_PARTITION_STATISTICS_TABLE = (
- lambda: f"DROP TABLE IF EXISTS `{CLICKHOUSE_DATABASE}`.events_plugin_ingestion_partition_statistics ON CLUSTER '{CLICKHOUSE_CLUSTER}' SYNC"
+DROP_EVENTS_PLUGIN_INGESTION_PARTITION_STATISTICS_TABLE = lambda: (
+ f"DROP TABLE IF EXISTS `{CLICKHOUSE_DATABASE}`.events_plugin_ingestion_partition_statistics ON CLUSTER '{CLICKHOUSE_CLUSTER}' SYNC"
)
-DROP_PARTITION_STATISTICS_MV = (
- lambda monitored_topic: f"DROP TABLE IF EXISTS `{CLICKHOUSE_DATABASE}`.{monitored_topic}_partition_statistics_mv ON CLUSTER '{CLICKHOUSE_CLUSTER}' SYNC"
+DROP_PARTITION_STATISTICS_MV = lambda monitored_topic: (
+ f"DROP TABLE IF EXISTS `{CLICKHOUSE_DATABASE}`.{monitored_topic}_partition_statistics_mv ON CLUSTER '{CLICKHOUSE_CLUSTER}' SYNC"
)
operations = map(
diff --git a/posthog/clickhouse/traces/spans.py b/posthog/clickhouse/traces/spans.py
index d2ff89cf5148..d80d840c7316 100644
--- a/posthog/clickhouse/traces/spans.py
+++ b/posthog/clickhouse/traces/spans.py
@@ -6,8 +6,8 @@ from .trace_attributes import TABLE_NAME as TRACE_ATTRIBUTES_TABLE_NAME
TABLE_NAME = "trace_spans"
-TTL = (
- lambda: "TTL timestamp + toIntervalHour(25) TO DISK 's3'" if settings.CLICKHOUSE_LOGS_ENABLE_STORAGE_POLICY else ""
+TTL = lambda: (
+ "TTL timestamp + toIntervalHour(25) TO DISK 's3'" if settings.CLICKHOUSE_LOGS_ENABLE_STORAGE_POLICY else ""
)
STORAGE_POLICY = lambda: "tiered" if settings.CLICKHOUSE_LOGS_ENABLE_STORAGE_POLICY else "default"
diff --git a/posthog/demo/products/hedgebox/models.py b/posthog/demo/products/hedgebox/models.py
index ff2bb6a9ce25..51783fbe658e 100644
--- a/posthog/demo/products/hedgebox/models.py
+++ b/posthog/demo/products/hedgebox/models.py
@@ -923,8 +923,9 @@ class HedgeboxPerson(SimPerson):
invite_id = str(self.cluster.roll_uuidt())
self.schedule_effect(
self.cluster.simulation_time,
- lambda other: other.set_attribute("invite_to_use_id", invite_id)
- and other.set_attribute("is_invitable", False),
+ lambda other: (
+ other.set_attribute("invite_to_use_id", invite_id) and other.set_attribute("is_invitable", False)
+ ),
Effect.Target.RANDOM_NEIGHBOR,
condition=lambda other: cast(HedgeboxPerson, other).is_invitable,
)
diff --git a/posthog/heatmaps/sql.py b/posthog/heatmaps/sql.py
index 15f4af82a431..424ea0a1e0e1 100644
--- a/posthog/heatmaps/sql.py
+++ b/posthog/heatmaps/sql.py
@@ -166,15 +166,15 @@ DISTRIBUTED_HEATMAPS_TABLE_SQL = lambda: HEATMAPS_TABLE_BASE_SQL.format(
),
)
-DROP_HEATMAPS_TABLE_SQL = lambda: (f"DROP TABLE IF EXISTS {HEATMAPS_DATA_TABLE()}")
+DROP_HEATMAPS_TABLE_SQL = lambda: f"DROP TABLE IF EXISTS {HEATMAPS_DATA_TABLE()}"
-DROP_WRITABLE_HEATMAPS_TABLE_SQL = lambda: (f"DROP TABLE IF EXISTS {HEATMAPS_WRITABLE_TABLE}")
+DROP_WRITABLE_HEATMAPS_TABLE_SQL = lambda: f"DROP TABLE IF EXISTS {HEATMAPS_WRITABLE_TABLE}"
-DROP_HEATMAPS_TABLE_MV_SQL = lambda: (f"DROP TABLE IF EXISTS heatmaps_mv")
+DROP_HEATMAPS_TABLE_MV_SQL = lambda: f"DROP TABLE IF EXISTS heatmaps_mv"
-DROP_KAFKA_HEATMAPS_TABLE_SQL = lambda: (f"DROP TABLE IF EXISTS kafka_heatmaps")
+DROP_KAFKA_HEATMAPS_TABLE_SQL = lambda: f"DROP TABLE IF EXISTS kafka_heatmaps"
-TRUNCATE_HEATMAPS_TABLE_SQL = lambda: (f"TRUNCATE TABLE IF EXISTS {HEATMAPS_DATA_TABLE()}")
+TRUNCATE_HEATMAPS_TABLE_SQL = lambda: f"TRUNCATE TABLE IF EXISTS {HEATMAPS_DATA_TABLE()}"
ALTER_TABLE_ADD_TTL_PERIOD = lambda: (
f"ALTER TABLE {HEATMAPS_DATA_TABLE()} MODIFY {ttl_period('timestamp', 90, unit='DAY')}"
diff --git a/posthog/models/app_metrics/sql.py b/posthog/models/app_metrics/sql.py
index 3fc9517edbf7..19ee1fbb4c74 100644
--- a/posthog/models/app_metrics/sql.py
+++ b/posthog/models/app_metrics/sql.py
@@ -46,8 +46,8 @@ BASE_APP_METRICS_COLUMNS = """
# we need to revisit producers (e.g. the webhook service currently known as rusty-hook or pgqueue).
APP_METRICS_TIMESTAMP_TRUNCATION = "toStartOfHour(timestamp)"
-APP_METRICS_DATA_TABLE_SQL = (
- lambda on_cluster=True: f"""
+APP_METRICS_DATA_TABLE_SQL = lambda on_cluster=True: (
+ f"""
CREATE TABLE IF NOT EXISTS {APP_METRICS_SHARDED_TABLE} {ON_CLUSTER_CLAUSE(on_cluster)}
(
{BASE_APP_METRICS_COLUMNS}
@@ -60,8 +60,8 @@ ORDER BY (team_id, plugin_config_id, job_id, category, {APP_METRICS_TIMESTAMP_TR
)
-DISTRIBUTED_APP_METRICS_TABLE_SQL = (
- lambda: f"""
+DISTRIBUTED_APP_METRICS_TABLE_SQL = lambda: (
+ f"""
CREATE TABLE IF NOT EXISTS {APP_METRICS_TABLE}
(
{BASE_APP_METRICS_COLUMNS}
@@ -71,8 +71,8 @@ ENGINE={Distributed(data_table=APP_METRICS_SHARDED_TABLE, sharding_key="rand()")
"""
)
-WRITABLE_APP_METRICS_TABLE_SQL = (
- lambda: f"""
+WRITABLE_APP_METRICS_TABLE_SQL = lambda: (
+ f"""
CREATE TABLE IF NOT EXISTS {APP_METRICS_WRITABLE_TABLE}
(
{BASE_APP_METRICS_COLUMNS}
@@ -82,8 +82,8 @@ ENGINE={Distributed(data_table=APP_METRICS_SHARDED_TABLE, sharding_key="rand()")
"""
)
-KAFKA_APP_METRICS_TABLE_SQL = (
- lambda: f"""
+KAFKA_APP_METRICS_TABLE_SQL = lambda: (
+ f"""
CREATE TABLE IF NOT EXISTS {KAFKA_APP_METRICS_TABLE}
(
team_id Int64,
diff --git a/posthog/models/app_metrics2/sql.py b/posthog/models/app_metrics2/sql.py
index c99a0c1e9f11..a927f08dfee5 100644
--- a/posthog/models/app_metrics2/sql.py
+++ b/posthog/models/app_metrics2/sql.py
@@ -50,8 +50,8 @@ BASE_APP_METRICS2_COLUMNS = """
# we need to revisit producers (e.g. the webhook service currently known as rusty-hook or pgqueue).
APP_METRICS2_TIMESTAMP_TRUNCATION = "toStartOfHour(timestamp)"
-APP_METRICS2_DATA_TABLE_SQL = (
- lambda: f"""
+APP_METRICS2_DATA_TABLE_SQL = lambda: (
+ f"""
CREATE TABLE IF NOT EXISTS {APP_METRICS2_SHARDED_TABLE}
(
{BASE_APP_METRICS2_COLUMNS}
@@ -64,8 +64,8 @@ ORDER BY (team_id, app_source, app_source_id, instance_id, {APP_METRICS2_TIMESTA
"""
)
-DISTRIBUTED_APP_METRICS2_TABLE_SQL = (
- lambda: f"""
+DISTRIBUTED_APP_METRICS2_TABLE_SQL = lambda: (
+ f"""
CREATE TABLE IF NOT EXISTS {APP_METRICS2_TABLE}
(
{BASE_APP_METRICS2_COLUMNS}
@@ -75,8 +75,8 @@ ENGINE={Distributed(data_table=APP_METRICS2_SHARDED_TABLE, sharding_key="rand()"
"""
)
-WRITABLE_APP_METRICS2_TABLE_SQL = (
- lambda: f"""
+WRITABLE_APP_METRICS2_TABLE_SQL = lambda: (
+ f"""
CREATE TABLE IF NOT EXISTS {APP_METRICS2_WRITABLE_TABLE}
(
{BASE_APP_METRICS2_COLUMNS}
@@ -86,8 +86,8 @@ ENGINE={Distributed(data_table=APP_METRICS2_SHARDED_TABLE, sharding_key="rand()"
"""
)
-KAFKA_APP_METRICS2_TABLE_SQL = (
- lambda: f"""
+KAFKA_APP_METRICS2_TABLE_SQL = lambda: (
+ f"""
CREATE TABLE IF NOT EXISTS {KAFKA_APP_METRICS2_TABLE}
(
team_id Int64,
@@ -103,8 +103,8 @@ ENGINE={kafka_engine(topic=KAFKA_APP_METRICS2, group=CONSUMER_GROUP_APP_METRICS2
"""
)
-APP_METRICS2_MV_TABLE_SQL = (
- lambda target_table=APP_METRICS2_WRITABLE_TABLE: f"""
+APP_METRICS2_MV_TABLE_SQL = lambda target_table=APP_METRICS2_WRITABLE_TABLE: (
+ f"""
CREATE MATERIALIZED VIEW IF NOT EXISTS app_metrics2_mv
TO {target_table}
AS SELECT
@@ -134,8 +134,8 @@ APP_METRICS2_WS_MV_TABLE = f"{APP_METRICS2_TABLE}_ws_mv"
DROP_APP_METRICS2_WS_MV_TABLE_SQL = f"DROP TABLE IF EXISTS {APP_METRICS2_WS_MV_TABLE}"
DROP_KAFKA_APP_METRICS2_WS_TABLE_SQL = f"DROP TABLE IF EXISTS {KAFKA_APP_METRICS2_WS_TABLE}"
-KAFKA_APP_METRICS2_WS_TABLE_SQL = (
- lambda: f"""
+KAFKA_APP_METRICS2_WS_TABLE_SQL = lambda: (
+ f"""
CREATE TABLE IF NOT EXISTS {KAFKA_APP_METRICS2_WS_TABLE}
(
team_id Int64,
@@ -157,8 +157,8 @@ ENGINE={
"""
)
-APP_METRICS2_WS_MV_TABLE_SQL = (
- lambda target_table=APP_METRICS2_WRITABLE_TABLE: f"""
+APP_METRICS2_WS_MV_TABLE_SQL = lambda target_table=APP_METRICS2_WRITABLE_TABLE: (
+ f"""
CREATE MATERIALIZED VIEW IF NOT EXISTS {APP_METRICS2_WS_MV_TABLE}
TO {target_table}
AS SELECT
diff --git a/posthog/models/channel_type/sql.py b/posthog/models/channel_type/sql.py
index e02818d2b734..939a2b6d3e73 100644
--- a/posthog/models/channel_type/sql.py
+++ b/posthog/models/channel_type/sql.py
@@ -9,8 +9,7 @@ from posthog.settings import CLICKHOUSE_CLUSTER, CLICKHOUSE_PASSWORD
CHANNEL_DEFINITION_TABLE_NAME = "channel_definition"
CHANNEL_DEFINITION_DICTIONARY_NAME = "channel_definition_dict"
-CHANNEL_DEFINITION_TABLE_SQL = (
- lambda on_cluster=True: """
+CHANNEL_DEFINITION_TABLE_SQL = lambda on_cluster=True: """
CREATE TABLE IF NOT EXISTS {table_name} {on_cluster_clause} (
domain String NOT NULL,
kind String NOT NULL,
@@ -20,10 +19,9 @@ CREATE TABLE IF NOT EXISTS {table_name} {on_cluster_clause} (
) ENGINE = {engine}
ORDER BY (domain, kind);
""".format(
- table_name=CHANNEL_DEFINITION_TABLE_NAME,
- engine=MergeTreeEngine("channel_definition", replication_scheme=ReplicationScheme.REPLICATED),
- on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster),
- )
+ table_name=CHANNEL_DEFINITION_TABLE_NAME,
+ engine=MergeTreeEngine("channel_definition", replication_scheme=ReplicationScheme.REPLICATED),
+ on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster),
)
@@ -49,8 +47,8 @@ def format_value(value):
raise ValueError(f"Unknown value type {type(value)}")
-CHANNEL_DEFINITION_DATA_SQL = (
- lambda channel_definitions=CHANNEL_DEFINITIONS: f"""
+CHANNEL_DEFINITION_DATA_SQL = lambda channel_definitions=CHANNEL_DEFINITIONS: (
+ f"""
INSERT INTO channel_definition (domain, kind, domain_type, type_if_paid, type_if_organic) VALUES
{
''',
@@ -61,8 +59,8 @@ INSERT INTO channel_definition (domain, kind, domain_type, type_if_paid, type_if
)
# Use COMPLEX_KEY_HASHED, as we have a composite key
-CHANNEL_DEFINITION_DICTIONARY_SQL = (
- lambda on_cluster=True: f"""
+CHANNEL_DEFINITION_DICTIONARY_SQL = lambda on_cluster=True: (
+ f"""
CREATE DICTIONARY IF NOT EXISTS {CHANNEL_DEFINITION_DICTIONARY_NAME} {ON_CLUSTER_CLAUSE(on_cluster)} (
domain String,
kind String,
diff --git a/posthog/models/event/sql.py b/posthog/models/event/sql.py
index 579206b98e3c..c1d479654171 100644
--- a/posthog/models/event/sql.py
+++ b/posthog/models/event/sql.py
@@ -472,8 +472,8 @@ def DISTRIBUTED_EVENTS_TABLE_SQL(on_cluster=True):
)
-INSERT_EVENT_SQL = (
- lambda: f"""
+INSERT_EVENT_SQL = lambda: (
+ f"""
INSERT INTO {EVENTS_DATA_TABLE()}
(
uuid,
@@ -531,8 +531,8 @@ VALUES
"""
)
-BULK_INSERT_EVENT_SQL = (
- lambda: f"""
+BULK_INSERT_EVENT_SQL = lambda: (
+ f"""
INSERT INTO {EVENTS_DATA_TABLE()}
(
uuid,
diff --git a/posthog/models/performance/sql.py b/posthog/models/performance/sql.py
index 3d0572f1dc54..8a3246b22776 100644
--- a/posthog/models/performance/sql.py
+++ b/posthog/models/performance/sql.py
@@ -96,8 +96,8 @@ def PERFORMANCE_EVENT_DATA_TABLE():
return "sharded_performance_events"
-PERFORMANCE_EVENTS_TABLE_BASE_SQL = (
- lambda: """
+PERFORMANCE_EVENTS_TABLE_BASE_SQL = lambda: (
+ """
CREATE TABLE IF NOT EXISTS {table_name} {on_cluster_clause}
(
{columns}
@@ -179,8 +179,7 @@ def WRITABLE_PERFORMANCE_EVENTS_TABLE_SQL(on_cluster=True):
)
-PERFORMANCE_EVENTS_TABLE_MV_SQL = (
- lambda: """
+PERFORMANCE_EVENTS_TABLE_MV_SQL = lambda: """
CREATE MATERIALIZED VIEW IF NOT EXISTS performance_events_mv ON CLUSTER '{cluster}'
TO {database}.{target_table}
AS SELECT
@@ -188,12 +187,11 @@ AS SELECT
,{extra_fields}
FROM {database}.kafka_performance_events
""".format(
- columns=_column_names_from_column_definitions(PERFORMANCE_EVENT_COLUMNS),
- target_table="writeable_performance_events",
- cluster=settings.CLICKHOUSE_CLUSTER,
- database=settings.CLICKHOUSE_DATABASE,
- extra_fields=_column_names_from_column_definitions(KAFKA_COLUMNS_WITH_PARTITION),
- )
+ columns=_column_names_from_column_definitions(PERFORMANCE_EVENT_COLUMNS),
+ target_table="writeable_performance_events",
+ cluster=settings.CLICKHOUSE_CLUSTER,
+ database=settings.CLICKHOUSE_DATABASE,
+ extra_fields=_column_names_from_column_definitions(KAFKA_COLUMNS_WITH_PARTITION),
)
# TODO this should probably be a materialized view
diff --git a/posthog/models/person/sql.py b/posthog/models/person/sql.py
index bcebdf84944a..b9a600e691e9 100644
--- a/posthog/models/person/sql.py
+++ b/posthog/models/person/sql.py
@@ -205,8 +205,7 @@ def PERSONS_DISTINCT_ID_TABLE_SQL(on_cluster=True):
# :KLUDGE: We default is_deleted to 0 for backwards compatibility for when we drop `is_deleted` from message schema.
# Can't make DEFAULT if(_sign==-1, 1, 0) because Cyclic aliases error.
-KAFKA_PERSONS_DISTINCT_ID_TABLE_SQL = (
- lambda on_cluster=True: """
+KAFKA_PERSONS_DISTINCT_ID_TABLE_SQL = lambda on_cluster=True: """
CREATE TABLE IF NOT EXISTS {table_name} {on_cluster_clause}
(
distinct_id VARCHAR,
@@ -216,10 +215,9 @@ CREATE TABLE IF NOT EXISTS {table_name} {on_cluster_clause}
is_deleted Nullable(Int8)
) ENGINE = {engine}
""".format(
- table_name="kafka_" + PERSONS_DISTINCT_ID_TABLE,
- on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster),
- engine=kafka_engine(KAFKA_PERSON_UNIQUE_ID),
- )
+ table_name="kafka_" + PERSONS_DISTINCT_ID_TABLE,
+ on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster),
+ engine=kafka_engine(KAFKA_PERSON_UNIQUE_ID),
)
@@ -415,8 +413,8 @@ def PERSON_DISTINCT_ID_OVERRIDES_TABLE_SQL(on_cluster=True):
)
-KAFKA_PERSON_DISTINCT_ID_OVERRIDES_TABLE_SQL = (
- lambda on_cluster=True: PERSON_DISTINCT_ID_OVERRIDES_TABLE_BASE_SQL.format(
+KAFKA_PERSON_DISTINCT_ID_OVERRIDES_TABLE_SQL = lambda on_cluster=True: (
+ PERSON_DISTINCT_ID_OVERRIDES_TABLE_BASE_SQL.format(
table_name=KAFKA_PERSON_DISTINCT_ID_OVERRIDES_TABLE,
on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster),
engine=kafka_engine(KAFKA_PERSON_DISTINCT_ID, group="clickhouse-person-distinct-id-overrides"),
@@ -675,8 +673,8 @@ ORDER BY actor_value DESC, actor_id DESC /* Also sorting by ID for determinism *
{offset}
"""
-COMMENT_DISTINCT_ID_COLUMN_SQL = (
- lambda: "ALTER TABLE person_distinct_id COMMENT COLUMN distinct_id 'skip_0003_fill_person_distinct_id2'"
+COMMENT_DISTINCT_ID_COLUMN_SQL = lambda: (
+ "ALTER TABLE person_distinct_id COMMENT COLUMN distinct_id 'skip_0003_fill_person_distinct_id2'"
)
diff --git a/posthog/models/person/util.py b/posthog/models/person/util.py
index ac8ccf41fc69..ba1f04d1d91a 100644
--- a/posthog/models/person/util.py
+++ b/posthog/models/person/util.py
@@ -617,9 +617,11 @@ def get_person_by_distinct_id(team_id: int, distinct_id: str) -> Optional[Person
return _personhog_routed(
"get_person_by_distinct_id",
lambda: _fetch_person_by_distinct_id_via_personhog(team_id, distinct_id),
- lambda: Person.objects.db_manager(READ_DB_FOR_PERSONS)
- .filter(team_id=team_id, persondistinctid__distinct_id=distinct_id)
- .first(),
+ lambda: (
+ Person.objects.db_manager(READ_DB_FOR_PERSONS)
+ .filter(team_id=team_id, persondistinctid__distinct_id=distinct_id)
+ .first()
+ ),
team_id=team_id,
)
diff --git a/posthog/models/person_overrides/sql.py b/posthog/models/person_overrides/sql.py
index 7c9686d9aee8..0d472a1c8dfb 100644
--- a/posthog/models/person_overrides/sql.py
+++ b/posthog/models/person_overrides/sql.py
@@ -8,8 +8,7 @@ from posthog.kafka_client.topics import KAFKA_PERSON_OVERRIDE
from posthog.settings.data_stores import CLICKHOUSE_DATABASE
from posthog.settings.kafka import KAFKA_HOSTS
-PERSON_OVERRIDES_CREATE_TABLE_SQL = (
- lambda on_cluster=True: f"""
+PERSON_OVERRIDES_CREATE_TABLE_SQL = lambda on_cluster=True: f"""
CREATE TABLE IF NOT EXISTS `{CLICKHOUSE_DATABASE}`.`person_overrides`
{ON_CLUSTER_CLAUSE(on_cluster)} (
team_id INT NOT NULL,
@@ -69,8 +68,7 @@ PERSON_OVERRIDES_CREATE_TABLE_SQL = (
-- ensure that we are always querying the latest version of the mapping.
ORDER BY (team_id, old_person_id)
""".format(
- engine=ReplacingMergeTree("person_overrides", replication_scheme=ReplicationScheme.REPLICATED, ver="version")
- )
+ engine=ReplacingMergeTree("person_overrides", replication_scheme=ReplicationScheme.REPLICATED, ver="version")
)
# An abstraction over Kafka that allows us to consume, via a ClickHouse
diff --git a/posthog/models/query_metrics/sql.py b/posthog/models/query_metrics/sql.py
index 027a16816f0e..1d12ac127180 100644
--- a/posthog/models/query_metrics/sql.py
+++ b/posthog/models/query_metrics/sql.py
@@ -6,8 +6,8 @@ from posthog.kafka_client.topics import KAFKA_METRICS_TIME_TO_SEE_DATA
from posthog.settings import CLICKHOUSE_CLUSTER, CLICKHOUSE_DATABASE
METRICS_TIME_TO_SEE_ENGINE = lambda: MergeTreeEngine("metrics_time_to_see_data", force_unique_zk_path=True)
-CREATE_METRICS_TIME_TO_SEE = (
- lambda: f"""
+CREATE_METRICS_TIME_TO_SEE = lambda: (
+ f"""
CREATE TABLE metrics_time_to_see_data ON CLUSTER '{CLICKHOUSE_CLUSTER}' (
`team_events_last_month` UInt64,
`query_id` String,
@@ -40,8 +40,8 @@ ORDER BY (team_id, toDate(timestamp), session_id, user_id)
DROP_METRICS_TIME_TO_SEE_TABLE = lambda: f"DROP TABLE metrics_time_to_see_data ON CLUSTER '{CLICKHOUSE_CLUSTER}' SYNC"
-CREATE_KAFKA_METRICS_TIME_TO_SEE = (
- lambda: f"""
+CREATE_KAFKA_METRICS_TIME_TO_SEE = lambda: (
+ f"""
CREATE TABLE kafka_metrics_time_to_see_data ON CLUSTER '{CLICKHOUSE_CLUSTER}' (
`team_events_last_month` UInt64,
`query_id` String,
@@ -69,12 +69,12 @@ ENGINE={kafka_engine(topic=KAFKA_METRICS_TIME_TO_SEE_DATA)}
SETTINGS kafka_skip_broken_messages = 9999
"""
)
-DROP_KAFKA_METRICS_TIME_TO_SEE = (
- lambda: f"DROP TABLE kafka_metrics_time_to_see_data ON CLUSTER '{CLICKHOUSE_CLUSTER}' SYNC"
+DROP_KAFKA_METRICS_TIME_TO_SEE = lambda: (
+ f"DROP TABLE kafka_metrics_time_to_see_data ON CLUSTER '{CLICKHOUSE_CLUSTER}' SYNC"
)
-CREATE_METRICS_TIME_TO_SEE_MV = (
- lambda: f"""
+CREATE_METRICS_TIME_TO_SEE_MV = lambda: (
+ f"""
CREATE MATERIALIZED VIEW metrics_time_to_see_data_mv ON CLUSTER '{CLICKHOUSE_CLUSTER}'
TO {CLICKHOUSE_DATABASE}.metrics_time_to_see_data
AS SELECT
@@ -109,8 +109,8 @@ DROP_METRICS_TIME_TO_SEE_MV = lambda: f"DROP TABLE metrics_time_to_see_data_mv O
METRICS_QUERY_LOG_TABLE_ENGINE = lambda: MergeTreeEngine("metrics_query_log", force_unique_zk_path=True)
-CREATE_METRICS_QUERY_LOG = (
- lambda: f"""
+CREATE_METRICS_QUERY_LOG = lambda: (
+ f"""
CREATE TABLE metrics_query_log ON CLUSTER '{CLICKHOUSE_CLUSTER}'
(
`host` String,
@@ -152,8 +152,8 @@ SETTINGS index_granularity = 8192
"""
)
-CREATE_METRICS_QUERY_LOG_MV = (
- lambda: f"""
+CREATE_METRICS_QUERY_LOG_MV = lambda: (
+ f"""
CREATE MATERIALIZED VIEW metrics_query_log_mv ON CLUSTER '{CLICKHOUSE_CLUSTER}'
TO metrics_query_log
AS
diff --git a/posthog/models/raw_sessions/migrations.py b/posthog/models/raw_sessions/migrations.py
index 581862ec4741..0020a6512040 100644
--- a/posthog/models/raw_sessions/migrations.py
+++ b/posthog/models/raw_sessions/migrations.py
@@ -55,22 +55,22 @@ AggregateFunction(uniqUpTo(1), Nullable(UUID))
AFTER maybe_has_session_replay
"""
-BASE_RAW_SESSIONS_ADD_PAGEVIEW_AUTOCAPTURE_SCREEN_UP_TO_2_COLUMN_SQL = (
- lambda: ADD_PAGEVIEW_AUTOCAPTURE_SCREEN_UP_TO_2_COLUMN_SQL.format(
+BASE_RAW_SESSIONS_ADD_PAGEVIEW_AUTOCAPTURE_SCREEN_UP_TO_2_COLUMN_SQL = lambda: (
+ ADD_PAGEVIEW_AUTOCAPTURE_SCREEN_UP_TO_2_COLUMN_SQL.format(
table_name=TABLE_BASE_NAME,
cluster=settings.CLICKHOUSE_CLUSTER,
)
)
-WRITABLE_RAW_SESSIONS_ADD_PAGEVIEW_AUTOCAPTURE_SCREEN_UP_TO_2_COLUMN_SQL = (
- lambda: ADD_PAGEVIEW_AUTOCAPTURE_SCREEN_UP_TO_2_COLUMN_SQL.format(
+WRITABLE_RAW_SESSIONS_ADD_PAGEVIEW_AUTOCAPTURE_SCREEN_UP_TO_2_COLUMN_SQL = lambda: (
+ ADD_PAGEVIEW_AUTOCAPTURE_SCREEN_UP_TO_2_COLUMN_SQL.format(
table_name=WRITABLE_RAW_SESSIONS_DATA_TABLE(),
cluster=settings.CLICKHOUSE_CLUSTER,
)
)
-DISTRIBUTED_RAW_SESSIONS_ADD_EVENT_COUNT_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ADD_PAGEVIEW_AUTOCAPTURE_SCREEN_UP_TO_2_COLUMN_SQL.format(
+DISTRIBUTED_RAW_SESSIONS_ADD_EVENT_COUNT_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ADD_PAGEVIEW_AUTOCAPTURE_SCREEN_UP_TO_2_COLUMN_SQL.format(
table_name=SHARDED_RAW_SESSIONS_DATA_TABLE(),
cluster=settings.CLICKHOUSE_CLUSTER,
)
diff --git a/posthog/models/raw_sessions/sessions_v2.py b/posthog/models/raw_sessions/sessions_v2.py
index 0371110d8b5d..e65c8419ed5d 100644
--- a/posthog/models/raw_sessions/sessions_v2.py
+++ b/posthog/models/raw_sessions/sessions_v2.py
@@ -186,8 +186,7 @@ def source_nullable_float_column(column_name: str) -> str:
return f"""accurateCastOrNull(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(properties, '{column_name}'), ''), 'null'), '^"|"$', ''), 'Float64')"""
-RAW_SESSION_TABLE_BACKFILL_SELECT_SQL = (
- lambda: """
+RAW_SESSION_TABLE_BACKFILL_SELECT_SQL = lambda: """
SELECT
team_id,
toUInt128(toUUID(`$session_id`)) as session_id_v7,
@@ -265,53 +264,51 @@ SELECT
FROM {database}.events
WHERE bitAnd(bitShiftRight(toUInt128(accurateCastOrNull(`$session_id`, 'UUID')), 76), 0xF) == 7 -- has a session id and is valid uuidv7
""".format(
- database=settings.CLICKHOUSE_DATABASE,
- current_url=source_url_column("$current_url"),
- current_url_string=source_string_column("$current_url"),
- external_click_url=source_string_column("$external_click_url"),
- browser=source_string_column("$browser"),
- browser_version=source_string_column("$browser_version"),
- os=source_string_column("$os"),
- os_version=source_string_column("$os_version"),
- device_type=source_string_column("$device_type"),
- viewport_width=source_int_column("$viewport_width"),
- viewport_height=source_int_column("$viewport_height"),
- geoip_country_code=source_string_column("$geoip_country_code"),
- geoip_subdivision_1_code=source_string_column("$geoip_subdivision_1_code"),
- geoip_subdivision_1_name=source_string_column("$geoip_subdivision_1_name"),
- geoip_subdivision_city_name=source_string_column("$geoip_subdivision_city_name"),
- geoip_time_zone=source_string_column("$geoip_time_zone"),
- referring_domain=source_string_column("$referring_domain"),
- utm_source=source_string_column("utm_source"),
- utm_campaign=source_string_column("utm_campaign"),
- utm_medium=source_string_column("utm_medium"),
- utm_term=source_string_column("utm_term"),
- utm_content=source_string_column("utm_content"),
- gclid=source_string_column("gclid"),
- gad_source=source_string_column("gad_source"),
- gclsrc=source_string_column("gclsrc"),
- dclid=source_string_column("dclid"),
- gbraid=source_string_column("gbraid"),
- wbraid=source_string_column("wbraid"),
- fbclid=source_string_column("fbclid"),
- msclkid=source_string_column("msclkid"),
- twclid=source_string_column("twclid"),
- li_fat_id=source_string_column("li_fat_id"),
- mc_cid=source_string_column("mc_cid"),
- igshid=source_string_column("igshid"),
- ttclid=source_string_column("ttclid"),
- epik=source_string_column("epik"),
- qclid=source_string_column("qclid"),
- sccid=source_string_column("sccid"),
- kx=source_string_column("_kx"),
- irclid=source_string_column("irclid"),
- vitals_lcp=source_nullable_float_column("$web_vitals_LCP_value"),
- )
+ database=settings.CLICKHOUSE_DATABASE,
+ current_url=source_url_column("$current_url"),
+ current_url_string=source_string_column("$current_url"),
+ external_click_url=source_string_column("$external_click_url"),
+ browser=source_string_column("$browser"),
+ browser_version=source_string_column("$browser_version"),
+ os=source_string_column("$os"),
+ os_version=source_string_column("$os_version"),
+ device_type=source_string_column("$device_type"),
+ viewport_width=source_int_column("$viewport_width"),
+ viewport_height=source_int_column("$viewport_height"),
+ geoip_country_code=source_string_column("$geoip_country_code"),
+ geoip_subdivision_1_code=source_string_column("$geoip_subdivision_1_code"),
+ geoip_subdivision_1_name=source_string_column("$geoip_subdivision_1_name"),
+ geoip_subdivision_city_name=source_string_column("$geoip_subdivision_city_name"),
+ geoip_time_zone=source_string_column("$geoip_time_zone"),
+ referring_domain=source_string_column("$referring_domain"),
+ utm_source=source_string_column("utm_source"),
+ utm_campaign=source_string_column("utm_campaign"),
+ utm_medium=source_string_column("utm_medium"),
+ utm_term=source_string_column("utm_term"),
+ utm_content=source_string_column("utm_content"),
+ gclid=source_string_column("gclid"),
+ gad_source=source_string_column("gad_source"),
+ gclsrc=source_string_column("gclsrc"),
+ dclid=source_string_column("dclid"),
+ gbraid=source_string_column("gbraid"),
+ wbraid=source_string_column("wbraid"),
+ fbclid=source_string_column("fbclid"),
+ msclkid=source_string_column("msclkid"),
+ twclid=source_string_column("twclid"),
+ li_fat_id=source_string_column("li_fat_id"),
+ mc_cid=source_string_column("mc_cid"),
+ igshid=source_string_column("igshid"),
+ ttclid=source_string_column("ttclid"),
+ epik=source_string_column("epik"),
+ qclid=source_string_column("qclid"),
+ sccid=source_string_column("sccid"),
+ kx=source_string_column("_kx"),
+ irclid=source_string_column("irclid"),
+ vitals_lcp=source_nullable_float_column("$web_vitals_LCP_value"),
)
-RAW_SESSION_TABLE_MV_SELECT_SQL = (
- lambda: """
+RAW_SESSION_TABLE_MV_SELECT_SQL = lambda: """
SELECT
team_id,
toUInt128(toUUID(`$session_id`)) as session_id_v7,
@@ -394,75 +391,70 @@ GROUP BY
cityHash64(session_id_v7),
session_id_v7
""".format(
- database=settings.CLICKHOUSE_DATABASE,
- current_url=source_url_column("$current_url"),
- current_url_string=source_string_column("$current_url"),
- external_click_url=source_string_column("$external_click_url"),
- referring_domain=source_string_column("$referring_domain"),
- browser=source_string_column("$browser"),
- browser_version=source_string_column("$browser_version"),
- os=source_string_column("$os"),
- os_version=source_string_column("$os_version"),
- device_type=source_string_column("$device_type"),
- viewport_width=source_int_column("$viewport_width"),
- viewport_height=source_int_column("$viewport_height"),
- geoip_country_code=source_string_column("$geoip_country_code"),
- geoip_subdivision_1_code=source_string_column("$geoip_subdivision_1_code"),
- geoip_subdivision_1_name=source_string_column("$geoip_subdivision_1_name"),
- geoip_subdivision_city_name=source_string_column("$geoip_subdivision_city_name"),
- geoip_time_zone=source_string_column("$geoip_time_zone"),
- utm_source=source_string_column("utm_source"),
- utm_campaign=source_string_column("utm_campaign"),
- utm_medium=source_string_column("utm_medium"),
- utm_term=source_string_column("utm_term"),
- utm_content=source_string_column("utm_content"),
- gclid=source_string_column("gclid"),
- gad_source=source_string_column("gad_source"),
- gclsrc=source_string_column("gclsrc"),
- dclid=source_string_column("dclid"),
- gbraid=source_string_column("gbraid"),
- wbraid=source_string_column("wbraid"),
- fbclid=source_string_column("fbclid"),
- msclkid=source_string_column("msclkid"),
- twclid=source_string_column("twclid"),
- li_fat_id=source_string_column("li_fat_id"),
- mc_cid=source_string_column("mc_cid"),
- igshid=source_string_column("igshid"),
- ttclid=source_string_column("ttclid"),
- epik=source_string_column("epik"),
- qclid=source_string_column("qclid"),
- sccid=source_string_column("sccid"),
- kx=source_string_column("_kx"),
- irclid=source_string_column("irclid"),
- vitals_lcp=source_nullable_float_column("$web_vitals_LCP_value"),
- )
+ database=settings.CLICKHOUSE_DATABASE,
+ current_url=source_url_column("$current_url"),
+ current_url_string=source_string_column("$current_url"),
+ external_click_url=source_string_column("$external_click_url"),
+ referring_domain=source_string_column("$referring_domain"),
+ browser=source_string_column("$browser"),
+ browser_version=source_string_column("$browser_version"),
+ os=source_string_column("$os"),
+ os_version=source_string_column("$os_version"),
+ device_type=source_string_column("$device_type"),
+ viewport_width=source_int_column("$viewport_width"),
+ viewport_height=source_int_column("$viewport_height"),
+ geoip_country_code=source_string_column("$geoip_country_code"),
+ geoip_subdivision_1_code=source_string_column("$geoip_subdivision_1_code"),
+ geoip_subdivision_1_name=source_string_column("$geoip_subdivision_1_name"),
+ geoip_subdivision_city_name=source_string_column("$geoip_subdivision_city_name"),
+ geoip_time_zone=source_string_column("$geoip_time_zone"),
+ utm_source=source_string_column("utm_source"),
+ utm_campaign=source_string_column("utm_campaign"),
+ utm_medium=source_string_column("utm_medium"),
+ utm_term=source_string_column("utm_term"),
+ utm_content=source_string_column("utm_content"),
+ gclid=source_string_column("gclid"),
+ gad_source=source_string_column("gad_source"),
+ gclsrc=source_string_column("gclsrc"),
+ dclid=source_string_column("dclid"),
+ gbraid=source_string_column("gbraid"),
+ wbraid=source_string_column("wbraid"),
+ fbclid=source_string_column("fbclid"),
+ msclkid=source_string_column("msclkid"),
+ twclid=source_string_column("twclid"),
+ li_fat_id=source_string_column("li_fat_id"),
+ mc_cid=source_string_column("mc_cid"),
+ igshid=source_string_column("igshid"),
+ ttclid=source_string_column("ttclid"),
+ epik=source_string_column("epik"),
+ qclid=source_string_column("qclid"),
+ sccid=source_string_column("sccid"),
+ kx=source_string_column("_kx"),
+ irclid=source_string_column("irclid"),
+ vitals_lcp=source_nullable_float_column("$web_vitals_LCP_value"),
)
-RAW_SESSIONS_TABLE_MV_SQL = (
- lambda: """
+RAW_SESSIONS_TABLE_MV_SQL = lambda: """
CREATE MATERIALIZED VIEW IF NOT EXISTS {table_name} {on_cluster_clause}
TO {database}.{target_table}
AS
{select_sql}
""".format(
- table_name=f"{TABLE_BASE_NAME}_mv",
- target_table=f"writable_{TABLE_BASE_NAME}",
- on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster=False),
- database=settings.CLICKHOUSE_DATABASE,
- select_sql=RAW_SESSION_TABLE_MV_SELECT_SQL(),
- )
+ table_name=f"{TABLE_BASE_NAME}_mv",
+ target_table=f"writable_{TABLE_BASE_NAME}",
+ on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster=False),
+ database=settings.CLICKHOUSE_DATABASE,
+ select_sql=RAW_SESSION_TABLE_MV_SELECT_SQL(),
)
-RAW_SESSION_TABLE_UPDATE_SQL = (
- lambda: """
+RAW_SESSION_TABLE_UPDATE_SQL = lambda: """
ALTER TABLE {table_name} {on_cluster_clause}
MODIFY QUERY
{select_sql}
""".format(
- table_name=f"{TABLE_BASE_NAME}_mv",
- on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster=False),
- select_sql=RAW_SESSION_TABLE_MV_SELECT_SQL(),
- )
+ table_name=f"{TABLE_BASE_NAME}_mv",
+ on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster=False),
+ select_sql=RAW_SESSION_TABLE_MV_SELECT_SQL(),
)
# Distributed engine tables are only created if CLICKHOUSE_REPLICATED
@@ -499,8 +491,8 @@ def DISTRIBUTED_RAW_SESSIONS_TABLE_SQL(on_cluster=True):
# This is the view that can be queried directly, that handles aggregation of potentially multiple rows per session.
# Most queries won't use this directly as they will want to pre-filter rows before aggregation, but it's useful for
# debugging
-RAW_SESSIONS_CREATE_OR_REPLACE_VIEW_SQL = (
- lambda: f"""
+RAW_SESSIONS_CREATE_OR_REPLACE_VIEW_SQL = lambda: (
+ f"""
CREATE OR REPLACE VIEW {TABLE_BASE_NAME}_v {ON_CLUSTER_CLAUSE(on_cluster=False)} AS
SELECT
session_id_v7,
diff --git a/posthog/models/raw_sessions/sessions_v3.py b/posthog/models/raw_sessions/sessions_v3.py
index 021523cd332f..726d0e4bca37 100644
--- a/posthog/models/raw_sessions/sessions_v3.py
+++ b/posthog/models/raw_sessions/sessions_v3.py
@@ -683,8 +683,8 @@ def DISTRIBUTED_RAW_SESSIONS_TABLE_SQL_V3():
# This is the view that can be queried directly, that handles aggregation of potentially multiple rows per session.
# Most queries won't use this directly as they will want to pre-filter rows before aggregation, but it's useful for
# debugging
-RAW_SESSIONS_CREATE_OR_REPLACE_VIEW_SQL_V3 = (
- lambda: f"""
+RAW_SESSIONS_CREATE_OR_REPLACE_VIEW_SQL_V3 = lambda: (
+ f"""
CREATE OR REPLACE VIEW {TABLE_BASE_NAME_V3}_v AS
SELECT
session_id_v7,
diff --git a/posthog/models/sessions/sql.py b/posthog/models/sessions/sql.py
index 0a37113d9a26..53cfc8ac690f 100644
--- a/posthog/models/sessions/sql.py
+++ b/posthog/models/sessions/sql.py
@@ -144,8 +144,7 @@ def source_column(column_name: str) -> str:
return trim_quotes_expr(f"JSONExtractRaw(properties, '{column_name}')")
-SESSION_TABLE_MV_SELECT_SQL = (
- lambda: """
+SESSION_TABLE_MV_SELECT_SQL = lambda: """
SELECT
`$session_id` as session_id,
@@ -192,57 +191,52 @@ FROM {database}.sharded_events
WHERE `$session_id` IS NOT NULL AND `$session_id` != '' AND team_id IN ({allowed_team_ids})
GROUP BY `$session_id`, team_id
""".format(
- database=settings.CLICKHOUSE_DATABASE,
- current_url_property=source_column("$current_url"),
- referring_domain_property=source_column("$referring_domain"),
- utm_source_property=source_column("utm_source"),
- utm_campaign_property=source_column("utm_campaign"),
- utm_medium_property=source_column("utm_medium"),
- utm_term_property=source_column("utm_term"),
- utm_content_property=source_column("utm_content"),
- gclid_property=source_column("gclid"),
- gad_source_property=source_column("gad_source"),
- gclsrc_property=source_column("gclsrc"),
- dclid_property=source_column("dclid"),
- gbraid_property=source_column("gbraid"),
- wbraid_property=source_column("wbraid"),
- fbclid_property=source_column("fbclid"),
- msclkid_property=source_column("msclkid"),
- twclid_property=source_column("twclid"),
- li_fat_id_property=source_column("li_fat_id"),
- mc_cid_property=source_column("mc_cid"),
- igshid_property=source_column("igshid"),
- ttclid_property=source_column("ttclid"),
- epik_property=source_column("epik"),
- qclid_property=source_column("qclid"),
- sccid_property=source_column("sccid"),
- allowed_team_ids=ALLOWED_TEAM_IDS_SQL,
- )
+ database=settings.CLICKHOUSE_DATABASE,
+ current_url_property=source_column("$current_url"),
+ referring_domain_property=source_column("$referring_domain"),
+ utm_source_property=source_column("utm_source"),
+ utm_campaign_property=source_column("utm_campaign"),
+ utm_medium_property=source_column("utm_medium"),
+ utm_term_property=source_column("utm_term"),
+ utm_content_property=source_column("utm_content"),
+ gclid_property=source_column("gclid"),
+ gad_source_property=source_column("gad_source"),
+ gclsrc_property=source_column("gclsrc"),
+ dclid_property=source_column("dclid"),
+ gbraid_property=source_column("gbraid"),
+ wbraid_property=source_column("wbraid"),
+ fbclid_property=source_column("fbclid"),
+ msclkid_property=source_column("msclkid"),
+ twclid_property=source_column("twclid"),
+ li_fat_id_property=source_column("li_fat_id"),
+ mc_cid_property=source_column("mc_cid"),
+ igshid_property=source_column("igshid"),
+ ttclid_property=source_column("ttclid"),
+ epik_property=source_column("epik"),
+ qclid_property=source_column("qclid"),
+ sccid_property=source_column("sccid"),
+ allowed_team_ids=ALLOWED_TEAM_IDS_SQL,
)
-SESSIONS_TABLE_MV_SQL = (
- lambda: """
+SESSIONS_TABLE_MV_SQL = lambda: """
CREATE MATERIALIZED VIEW IF NOT EXISTS {table_name} {on_cluster_clause}
TO {database}.{target_table}
AS
{select_sql}
""".format(
- table_name=f"{TABLE_BASE_NAME}_mv",
- target_table=f"writable_{TABLE_BASE_NAME}",
- on_cluster_clause=ON_CLUSTER_CLAUSE(),
- database=settings.CLICKHOUSE_DATABASE,
- select_sql=SESSION_TABLE_MV_SELECT_SQL(),
- )
+ table_name=f"{TABLE_BASE_NAME}_mv",
+ target_table=f"writable_{TABLE_BASE_NAME}",
+ on_cluster_clause=ON_CLUSTER_CLAUSE(),
+ database=settings.CLICKHOUSE_DATABASE,
+ select_sql=SESSION_TABLE_MV_SELECT_SQL(),
)
-SESSION_TABLE_UPDATE_SQL = (
- lambda: """
+SESSION_TABLE_UPDATE_SQL = lambda: """
ALTER TABLE {table_name} MODIFY QUERY
{select_sql}
""".format(
- table_name=f"{TABLE_BASE_NAME}_mv",
- select_sql=SESSION_TABLE_MV_SELECT_SQL(),
- )
+ table_name=f"{TABLE_BASE_NAME}_mv",
+ select_sql=SESSION_TABLE_MV_SELECT_SQL(),
)
# Distributed engine tables are only created if CLICKHOUSE_REPLICATED
@@ -279,8 +273,8 @@ def DISTRIBUTED_SESSIONS_TABLE_SQL(on_cluster=True):
# This is the view that can be queried directly, that handles aggregation of potentially multiple rows per session.
# Most queries won't use this directly as they will want to pre-filter rows before aggregation, but it's useful for
# debugging
-SESSIONS_VIEW_SQL = (
- lambda: f"""
+SESSIONS_VIEW_SQL = lambda: (
+ f"""
CREATE OR REPLACE VIEW {TABLE_BASE_NAME}_v {ON_CLUSTER_CLAUSE()} AS
SELECT
session_id,
diff --git a/posthog/session_recordings/sql/session_replay_embeddings_migrations.py b/posthog/session_recordings/sql/session_replay_embeddings_migrations.py
index 0cb527330355..2ace6ce4de82 100644
--- a/posthog/session_recordings/sql/session_replay_embeddings_migrations.py
+++ b/posthog/session_recordings/sql/session_replay_embeddings_migrations.py
@@ -5,22 +5,22 @@ ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN = """
ADD COLUMN IF NOT EXISTS source_type LowCardinality(String)
"""
-DISTRIBUTED_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN = (
- lambda: ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN.format(
+DISTRIBUTED_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN = lambda: (
+ ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN.format(
table_name="session_replay_embeddings",
cluster=settings.CLICKHOUSE_CLUSTER,
)
)
-WRITEABLE_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN = (
- lambda: ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN.format(
+WRITEABLE_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN = lambda: (
+ ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN.format(
table_name="writable_session_replay_embeddings",
cluster=settings.CLICKHOUSE_CLUSTER,
)
)
-SHARDED_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN = (
- lambda: ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN.format(
+SHARDED_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN = lambda: (
+ ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_TYPE_COLUMN.format(
table_name="sharded_session_replay_embeddings",
cluster=settings.CLICKHOUSE_CLUSTER,
)
@@ -31,22 +31,22 @@ ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN = """
ADD COLUMN IF NOT EXISTS input String
"""
-DISTRIBUTED_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN = (
- lambda: ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN.format(
+DISTRIBUTED_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN = lambda: (
+ ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN.format(
table_name="session_replay_embeddings",
cluster=settings.CLICKHOUSE_CLUSTER,
)
)
-WRITEABLE_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN = (
- lambda: ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN.format(
+WRITEABLE_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN = lambda: (
+ ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN.format(
table_name="writable_session_replay_embeddings",
cluster=settings.CLICKHOUSE_CLUSTER,
)
)
-SHARDED_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN = (
- lambda: ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN.format(
+SHARDED_TABLE_ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN = lambda: (
+ ALTER_SESSION_REPLAY_EMBEDDINGS_ADD_INPUT_COLUMN.format(
table_name="sharded_session_replay_embeddings",
cluster=settings.CLICKHOUSE_CLUSTER,
)
diff --git a/posthog/session_recordings/sql/session_replay_embeddings_sql.py b/posthog/session_recordings/sql/session_replay_embeddings_sql.py
index e5b8a63981e4..b1abd0449625 100644
--- a/posthog/session_recordings/sql/session_replay_embeddings_sql.py
+++ b/posthog/session_recordings/sql/session_replay_embeddings_sql.py
@@ -74,8 +74,8 @@ def WRITABLE_SESSION_REPLAY_EMBEDDINGS_TABLE_SQL(on_cluster=True):
# This table is responsible for reading from session_replay_embeddings on a cluster setting
-DISTRIBUTED_SESSION_REPLAY_EMBEDDINGS_TABLE_SQL = (
- lambda on_cluster=True: SESSION_REPLAY_EMBEDDINGS_TABLE_BASE_SQL.format(
+DISTRIBUTED_SESSION_REPLAY_EMBEDDINGS_TABLE_SQL = lambda on_cluster=True: (
+ SESSION_REPLAY_EMBEDDINGS_TABLE_BASE_SQL.format(
table_name="session_replay_embeddings",
on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster),
engine=Distributed(
diff --git a/posthog/session_recordings/sql/session_replay_event_migrations_sql.py b/posthog/session_recordings/sql/session_replay_event_migrations_sql.py
index 1297210e4b11..f6ed5bb67dcd 100644
--- a/posthog/session_recordings/sql/session_replay_event_migrations_sql.py
+++ b/posthog/session_recordings/sql/session_replay_event_migrations_sql.py
@@ -28,8 +28,8 @@ ALTER_SESSION_REPLAY_ADD_CONSOLE_COLUMNS = """
"""
-ADD_CONSOLE_COUNTS_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_CONSOLE_COLUMNS.format(
+ADD_CONSOLE_COUNTS_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_CONSOLE_COLUMNS.format(
table_name="session_replay_events",
cluster=settings.CLICKHOUSE_CLUSTER,
)
@@ -76,8 +76,8 @@ ALTER_SESSION_REPLAY_ADD_EVENT_COUNT_COLUMN = """
ADD COLUMN IF NOT EXISTS _timestamp SimpleAggregateFunction(max, DateTime)
"""
-ADD_EVENT_COUNT_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_EVENT_COUNT_COLUMN.format(
+ADD_EVENT_COUNT_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_EVENT_COUNT_COLUMN.format(
table_name="session_replay_events",
cluster=settings.CLICKHOUSE_CLUSTER,
)
@@ -161,14 +161,14 @@ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_COLUMN = """
ALTER TABLE {table_name} ADD COLUMN IF NOT EXISTS retention_period Nullable(String)
"""
-ADD_RETENTION_PERIOD_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_COLUMN.format(
+ADD_RETENTION_PERIOD_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_COLUMN.format(
table_name="session_replay_events",
)
)
-ADD_RETENTION_PERIOD_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_COLUMN.format(
+ADD_RETENTION_PERIOD_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_COLUMN.format(
table_name="writable_session_replay_events",
)
)
@@ -182,20 +182,20 @@ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_COLUMN = """
ALTER TABLE {table_name} ADD COLUMN IF NOT EXISTS retention_period_days Nullable(Int64)
"""
-ADD_RETENTION_PERIOD_DAYS_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_COLUMN.format(
+ADD_RETENTION_PERIOD_DAYS_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_COLUMN.format(
table_name="session_replay_events",
)
)
-ADD_RETENTION_PERIOD_DAYS_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_COLUMN.format(
+ADD_RETENTION_PERIOD_DAYS_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_COLUMN.format(
table_name="writable_session_replay_events",
)
)
-ADD_RETENTION_PERIOD_DAYS_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_COLUMN.format(
+ADD_RETENTION_PERIOD_DAYS_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_COLUMN.format(
table_name=SESSION_REPLAY_EVENTS_DATA_TABLE(),
)
)
@@ -204,20 +204,20 @@ ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_COLUMN = """
ALTER TABLE {table_name} DROP COLUMN IF EXISTS retention_period
"""
-DROP_RETENTION_PERIOD_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_COLUMN.format(
+DROP_RETENTION_PERIOD_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_COLUMN.format(
table_name="session_replay_events",
)
)
-DROP_RETENTION_PERIOD_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_COLUMN.format(
+DROP_RETENTION_PERIOD_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_COLUMN.format(
table_name="writable_session_replay_events",
)
)
-DROP_RETENTION_PERIOD_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_COLUMN.format(
+DROP_RETENTION_PERIOD_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_COLUMN.format(
table_name=SESSION_REPLAY_EVENTS_DATA_TABLE(),
)
)
@@ -262,38 +262,38 @@ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE = """
ADD COLUMN IF NOT EXISTS retention_period_days SimpleAggregateFunction(max, Nullable(Int64))
"""
-DROP_RETENTION_PERIOD_DAYS_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_DAYS.format(
+DROP_RETENTION_PERIOD_DAYS_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_DAYS.format(
table_name="session_replay_events",
)
)
-DROP_RETENTION_PERIOD_DAYS_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_DAYS.format(
+DROP_RETENTION_PERIOD_DAYS_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_DAYS.format(
table_name="writable_session_replay_events",
)
)
-DROP_RETENTION_PERIOD_DAYS_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_DAYS.format(
+DROP_RETENTION_PERIOD_DAYS_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_DROP_RETENTION_PERIOD_DAYS.format(
table_name=SESSION_REPLAY_EVENTS_DATA_TABLE(),
)
)
-ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE.format(
+ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE.format(
table_name="session_replay_events",
)
)
-ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE.format(
+ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE.format(
table_name="writable_session_replay_events",
)
)
-ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE.format(
+ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_RETENTION_PERIOD_DAYS_AGGREGATE_TYPE.format(
table_name=SESSION_REPLAY_EVENTS_DATA_TABLE(),
)
)
@@ -392,14 +392,14 @@ ADD_SURFACING_SCORE_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: ALTER_SESSION_REPL
table_name=SESSION_REPLAY_EVENTS_DATA_TABLE(),
)
-ADD_SURFACING_SCORE_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_SURFACING_SCORE_COLUMN.format(
+ADD_SURFACING_SCORE_WRITABLE_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_SURFACING_SCORE_COLUMN.format(
table_name="writable_session_replay_events",
)
)
-ADD_SURFACING_SCORE_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = (
- lambda: ALTER_SESSION_REPLAY_ADD_SURFACING_SCORE_COLUMN.format(
+ADD_SURFACING_SCORE_DISTRIBUTED_SESSION_REPLAY_EVENTS_TABLE_SQL = lambda: (
+ ALTER_SESSION_REPLAY_ADD_SURFACING_SCORE_COLUMN.format(
table_name="session_replay_events",
)
)
diff --git a/posthog/session_recordings/test/test_session_recordings_sharing.py b/posthog/session_recordings/test/test_session_recordings_sharing.py
index 6ff016ea5b9d..fb9d8b8e1f1f 100644
--- a/posthog/session_recordings/test/test_session_recordings_sharing.py
+++ b/posthog/session_recordings/test/test_session_recordings_sharing.py
@@ -84,8 +84,9 @@ class TestSessionRecordingsSharing(APIBaseTest, ClickhouseTestMixin, QueryMatchi
),
(
"accessing the same session from a different team",
- lambda self,
- token: f"/api/projects/{self.other_team.id}/session_recordings/{self.session_id}?sharing_access_token={token}",
+ lambda self, token: (
+ f"/api/projects/{self.other_team.id}/session_recordings/{self.session_id}?sharing_access_token={token}"
+ ),
),
]
)
diff --git a/posthog/temporal/data_imports/external_data_job.py b/posthog/temporal/data_imports/external_data_job.py
index ac58a5b593bd..d231e17d003d 100644
--- a/posthog/temporal/data_imports/external_data_job.py
+++ b/posthog/temporal/data_imports/external_data_job.py
@@ -113,9 +113,11 @@ async def update_external_data_job_model(inputs: UpdateExternalDataJobStatusInpu
if inputs.job_id is None:
job: ExternalDataJob | None = await database_sync_to_async_pool(
- lambda: ExternalDataJob.objects.filter(schema_id=inputs.schema_id, status=ExternalDataJob.Status.RUNNING)
- .order_by("-created_at")
- .first()
+ lambda: (
+ ExternalDataJob.objects.filter(schema_id=inputs.schema_id, status=ExternalDataJob.Status.RUNNING)
+ .order_by("-created_at")
+ .first()
+ )
)()
if job is None:
logger.info("No job to update status on")
diff --git a/posthog/temporal/tests/session_replay/export_recording/test_activities.py b/posthog/temporal/tests/session_replay/export_recording/test_activities.py
index 23840a619b7b..7bdabe04d435 100644
--- a/posthog/temporal/tests/session_replay/export_recording/test_activities.py
+++ b/posthog/temporal/tests/session_replay/export_recording/test_activities.py
@@ -429,11 +429,9 @@ async def test_store_export_data_success(tmp_path):
mock_path_cls.return_value.__truediv__ = MagicMock(side_effect=truediv_side_effect)
mock_export_dir.__truediv__ = MagicMock(
- side_effect=lambda p: mock_clickhouse_dir
- if p == "clickhouse"
- else mock_data_dir
- if p == "data"
- else MagicMock()
+ side_effect=lambda p: (
+ mock_clickhouse_dir if p == "clickhouse" else mock_data_dir if p == "data" else MagicMock()
+ )
)
mock_record_qs.aget = AsyncMock(return_value=mock_record)
diff --git a/products/batch_exports/backend/temporal/destinations/snowflake_batch_export.py b/products/batch_exports/backend/temporal/destinations/snowflake_batch_export.py
index ed149333efb1..0584c6137bd2 100644
--- a/products/batch_exports/backend/temporal/destinations/snowflake_batch_export.py
+++ b/products/batch_exports/backend/temporal/destinations/snowflake_batch_export.py
@@ -1018,8 +1018,9 @@ class SnowflakeClient:
max_attempts=max_attempts,
retryable_exceptions=(snowflake.connector.errors.ProgrammingError,),
# 608 = Warehouse suspended error
- is_exception_retryable=lambda e: isinstance(e, snowflake.connector.errors.ProgrammingError)
- and (e.errno == 608 or e.errno == 90073),
+ is_exception_retryable=lambda e: (
+ isinstance(e, snowflake.connector.errors.ProgrammingError) and (e.errno == 608 or e.errno == 90073)
+ ),
)
# We need to explicitly catch exceptions here because otherwise they seem to be swallowed
diff --git a/products/cohorts/backend/models/sql.py b/products/cohorts/backend/models/sql.py
index 6a123ba9f04f..ed055a51c658 100644
--- a/products/cohorts/backend/models/sql.py
+++ b/products/cohorts/backend/models/sql.py
@@ -12,8 +12,7 @@ def COHORTPEOPLE_TABLE_ENGINE():
return CollapsingMergeTree("cohortpeople", ver="sign")
-CREATE_COHORTPEOPLE_TABLE_SQL = (
- lambda on_cluster=True: """
+CREATE_COHORTPEOPLE_TABLE_SQL = lambda on_cluster=True: """
CREATE TABLE IF NOT EXISTS cohortpeople {on_cluster_clause}
(
person_id UUID,
@@ -25,10 +24,9 @@ CREATE TABLE IF NOT EXISTS cohortpeople {on_cluster_clause}
Order By (team_id, cohort_id, person_id, version)
{storage_policy}
""".format(
- on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster),
- engine=COHORTPEOPLE_TABLE_ENGINE(),
- storage_policy="",
- )
+ on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster),
+ engine=COHORTPEOPLE_TABLE_ENGINE(),
+ storage_policy="",
)
TRUNCATE_COHORTPEOPLE_TABLE_SQL = f"TRUNCATE TABLE IF EXISTS cohortpeople ON CLUSTER '{CLICKHOUSE_CLUSTER}'"
diff --git a/products/error_tracking/backend/sql.py b/products/error_tracking/backend/sql.py
index a64f113615a9..e227c6e055c7 100644
--- a/products/error_tracking/backend/sql.py
+++ b/products/error_tracking/backend/sql.py
@@ -67,8 +67,8 @@ ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_TABLE_SQL = lambda on_cluster=True: (
""",
)
-KAFKA_ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_TABLE_SQL = (
- lambda on_cluster=True: ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_TABLE_BASE_SQL.format(
+KAFKA_ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_TABLE_SQL = lambda on_cluster=True: (
+ ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_TABLE_BASE_SQL.format(
table_name=ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_KAFKA_TABLE,
on_cluster_clause=ON_CLUSTER_CLAUSE(on_cluster),
engine=kafka_engine(
@@ -105,8 +105,8 @@ WHERE version > 0 -- only store updated rows, not newly inserted ones
)
-WRITABLE_ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_TABLE_SQL = (
- lambda: ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_TABLE_BASE_SQL.format(
+WRITABLE_ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_TABLE_SQL = lambda: (
+ ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_TABLE_BASE_SQL.format(
table_name=ERROR_TRACKING_ISSUE_FINGERPRINT_OVERRIDES_WRITABLE_TABLE,
on_cluster_clause=ON_CLUSTER_CLAUSE(False),
engine=Distributed(
@@ -281,8 +281,8 @@ FROM {database}.{kafka_table}
)
-WRITABLE_ERROR_TRACKING_FINGERPRINT_ISSUE_STATE_TABLE_SQL = (
- lambda: ERROR_TRACKING_FINGERPRINT_ISSUE_STATE_TABLE_BASE_SQL.format(
+WRITABLE_ERROR_TRACKING_FINGERPRINT_ISSUE_STATE_TABLE_SQL = lambda: (
+ ERROR_TRACKING_FINGERPRINT_ISSUE_STATE_TABLE_BASE_SQL.format(
table_name=ERROR_TRACKING_FINGERPRINT_ISSUE_STATE_WRITABLE_TABLE,
on_cluster_clause=ON_CLUSTER_CLAUSE(False),
engine=Distributed(
diff --git a/products/event_definitions/backend/models/property_definition.py b/products/event_definitions/backend/models/property_definition.py
index c1fcf74c36e9..1cbf932ee5f4 100644
--- a/products/event_definitions/backend/models/property_definition.py
+++ b/products/event_definitions/backend/models/property_definition.py
@@ -133,8 +133,8 @@ class PropertyDefinition(UUIDTModel):
# ClickHouse Table DDL
-PROPERTY_DEFINITIONS_TABLE_SQL = (
- lambda: f"""
+PROPERTY_DEFINITIONS_TABLE_SQL = lambda: (
+ f"""
CREATE TABLE IF NOT EXISTS `{CLICKHOUSE_DATABASE}`.`property_definitions`
(
-- Team and project relationships
diff --git a/products/tasks/backend/temporal/execute_sandbox/workflow.py b/products/tasks/backend/temporal/execute_sandbox/workflow.py
index 2dcdfd779c5a..09081ff522ba 100644
--- a/products/tasks/backend/temporal/execute_sandbox/workflow.py
+++ b/products/tasks/backend/temporal/execute_sandbox/workflow.py
@@ -318,10 +318,12 @@ class ExecuteSandboxWorkflow(PostHogWorkflow):
async def _wait_for_signal(self) -> SandboxEvent:
await workflow.wait_condition(
- lambda: self._task_completed
- or self._heartbeat_received
- or len(self._pending_followups) > 0
- or len(self._pending_outbound) > 0
+ lambda: (
+ self._task_completed
+ or self._heartbeat_received
+ or len(self._pending_followups) > 0
+ or len(self._pending_outbound) > 0
+ )
)
return SandboxEvent.SIGNAL_RECEIVED
diff --git a/products/tasks/backend/temporal/process_task/workflow.py b/products/tasks/backend/temporal/process_task/workflow.py
index 346bc641f7f7..3193e13157f7 100644
--- a/products/tasks/backend/temporal/process_task/workflow.py
+++ b/products/tasks/backend/temporal/process_task/workflow.py
@@ -204,10 +204,12 @@ class ProcessTaskWorkflow(PostHogWorkflow):
async def _wait_for_task_external_event(self):
await workflow.wait_condition(
- lambda: self._task_completed
- or self._heartbeat_received
- or self._pending_followup is not None
- or len(self._pending_followups) > 0
+ lambda: (
+ self._task_completed
+ or self._heartbeat_received
+ or self._pending_followup is not None
+ or len(self._pending_followups) > 0
+ )
)
return TaskEvent.SIGNAL_RECEIVED
diff --git a/pyproject.toml b/pyproject.toml
index a0a7110fb1ef..68870a64b05b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -250,7 +250,7 @@ dev = [
"python-dateutil~=2.9.0",
"requests-mock~=1.12.1",
"responses==0.23.1",
- "ruff~=0.14.11",
+ "ruff~=0.15.16",
"stpyv8==13.1.201.22; sys_platform != 'linux' or (platform_machine != 'aarch64' and platform_machine != 'arm64')",
"syrupy~=4.9.1",
"tach~=0.34",
@@ -325,6 +325,7 @@ ignore = [
"UP045", # ~3064: Optional[X] → X | None (auto-fixable)
"UP046", # ~39: generic class → PEP 695 (unsafe)
"UP047", # ~37: generic func → PEP 695 (unsafe)
+ "UP042", # ~28: str+Enum → StrEnum (unsafe: changes str()/format() output)
]
select = [
"B",
diff --git a/uv.lock b/uv.lock
index 7f649fc6a7ce..7a700ed7c791 100644
--- a/uv.lock
+++ b/uv.lock
@@ -5924,7 +5924,7 @@ dev = [
{ name = "pywatchman", specifier = "~=3.0" },
{ name = "requests-mock", specifier = "~=1.12.1" },
{ name = "responses", specifier = "==0.23.1" },
- { name = "ruff", specifier = "~=0.14.11" },
+ { name = "ruff", specifier = "~=0.15.16" },
{ name = "stpyv8", marker = "(platform_machine != 'aarch64' and platform_machine != 'arm64') or sys_platform != 'linux'", specifier = "==13.1.201.22" },
{ name = "syrupy", specifier = "~=4.9.1" },
{ name = "tach", specifier = "~=0.34" },
@@ -7257,28 +7257,27 @@ wheels = [
[[package]]
name = "ruff"
-version = "0.14.11"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/d4/77/9a7fe084d268f8855d493e5031ea03fa0af8cc05887f638bf1c4e3363eb8/ruff-0.14.11.tar.gz", hash = "sha256:f6dc463bfa5c07a59b1ff2c3b9767373e541346ea105503b4c0369c520a66958", size = 5993417, upload-time = "2026-01-08T19:11:58.322Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/f0/a6/a4c40a5aaa7e331f245d2dc1ac8ece306681f52b636b40ef87c88b9f7afd/ruff-0.14.11-py3-none-linux_armv6l.whl", hash = "sha256:f6ff2d95cbd335841a7217bdfd9c1d2e44eac2c584197ab1385579d55ff8830e", size = 12951208, upload-time = "2026-01-08T19:12:09.218Z" },
- { url = "https://files.pythonhosted.org/packages/5c/5c/360a35cb7204b328b685d3129c08aca24765ff92b5a7efedbdd6c150d555/ruff-0.14.11-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6f6eb5c1c8033680f4172ea9c8d3706c156223010b8b97b05e82c59bdc774ee6", size = 13330075, upload-time = "2026-01-08T19:12:02.549Z" },
- { url = "https://files.pythonhosted.org/packages/1b/9e/0cc2f1be7a7d33cae541824cf3f95b4ff40d03557b575912b5b70273c9ec/ruff-0.14.11-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f2fc34cc896f90080fca01259f96c566f74069a04b25b6205d55379d12a6855e", size = 12257809, upload-time = "2026-01-08T19:12:00.366Z" },
- { url = "https://files.pythonhosted.org/packages/a7/e5/5faab97c15bb75228d9f74637e775d26ac703cc2b4898564c01ab3637c02/ruff-0.14.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53386375001773ae812b43205d6064dae49ff0968774e6befe16a994fc233caa", size = 12678447, upload-time = "2026-01-08T19:12:13.899Z" },
- { url = "https://files.pythonhosted.org/packages/1b/33/e9767f60a2bef779fb5855cab0af76c488e0ce90f7bb7b8a45c8a2ba4178/ruff-0.14.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a697737dce1ca97a0a55b5ff0434ee7205943d4874d638fe3ae66166ff46edbe", size = 12758560, upload-time = "2026-01-08T19:11:42.55Z" },
- { url = "https://files.pythonhosted.org/packages/eb/84/4c6cf627a21462bb5102f7be2a320b084228ff26e105510cd2255ea868e5/ruff-0.14.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6845ca1da8ab81ab1dce755a32ad13f1db72e7fba27c486d5d90d65e04d17b8f", size = 13599296, upload-time = "2026-01-08T19:11:30.371Z" },
- { url = "https://files.pythonhosted.org/packages/88/e1/92b5ed7ea66d849f6157e695dc23d5d6d982bd6aa8d077895652c38a7cae/ruff-0.14.11-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:e36ce2fd31b54065ec6f76cb08d60159e1b32bdf08507862e32f47e6dde8bcbf", size = 15048981, upload-time = "2026-01-08T19:12:04.742Z" },
- { url = "https://files.pythonhosted.org/packages/61/df/c1bd30992615ac17c2fb64b8a7376ca22c04a70555b5d05b8f717163cf9f/ruff-0.14.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:590bcc0e2097ecf74e62a5c10a6b71f008ad82eb97b0a0079e85defe19fe74d9", size = 14633183, upload-time = "2026-01-08T19:11:40.069Z" },
- { url = "https://files.pythonhosted.org/packages/04/e9/fe552902f25013dd28a5428a42347d9ad20c4b534834a325a28305747d64/ruff-0.14.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:53fe71125fc158210d57fe4da26e622c9c294022988d08d9347ec1cf782adafe", size = 14050453, upload-time = "2026-01-08T19:11:37.555Z" },
- { url = "https://files.pythonhosted.org/packages/ae/93/f36d89fa021543187f98991609ce6e47e24f35f008dfe1af01379d248a41/ruff-0.14.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a35c9da08562f1598ded8470fcfef2afb5cf881996e6c0a502ceb61f4bc9c8a3", size = 13757889, upload-time = "2026-01-08T19:12:07.094Z" },
- { url = "https://files.pythonhosted.org/packages/b7/9f/c7fb6ecf554f28709a6a1f2a7f74750d400979e8cd47ed29feeaa1bd4db8/ruff-0.14.11-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:0f3727189a52179393ecf92ec7057c2210203e6af2676f08d92140d3e1ee72c1", size = 13955832, upload-time = "2026-01-08T19:11:55.064Z" },
- { url = "https://files.pythonhosted.org/packages/db/a0/153315310f250f76900a98278cf878c64dfb6d044e184491dd3289796734/ruff-0.14.11-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:eb09f849bd37147a789b85995ff734a6c4a095bed5fd1608c4f56afc3634cde2", size = 12586522, upload-time = "2026-01-08T19:11:35.356Z" },
- { url = "https://files.pythonhosted.org/packages/2f/2b/a73a2b6e6d2df1d74bf2b78098be1572191e54bec0e59e29382d13c3adc5/ruff-0.14.11-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:c61782543c1231bf71041461c1f28c64b961d457d0f238ac388e2ab173d7ecb7", size = 12724637, upload-time = "2026-01-08T19:11:47.796Z" },
- { url = "https://files.pythonhosted.org/packages/f0/41/09100590320394401cd3c48fc718a8ba71c7ddb1ffd07e0ad6576b3a3df2/ruff-0.14.11-py3-none-musllinux_1_2_i686.whl", hash = "sha256:82ff352ea68fb6766140381748e1f67f83c39860b6446966cff48a315c3e2491", size = 13145837, upload-time = "2026-01-08T19:11:32.87Z" },
- { url = "https://files.pythonhosted.org/packages/3b/d8/e035db859d1d3edf909381eb8ff3e89a672d6572e9454093538fe6f164b0/ruff-0.14.11-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:728e56879df4ca5b62a9dde2dd0eb0edda2a55160c0ea28c4025f18c03f86984", size = 13850469, upload-time = "2026-01-08T19:12:11.694Z" },
- { url = "https://files.pythonhosted.org/packages/4e/02/bb3ff8b6e6d02ce9e3740f4c17dfbbfb55f34c789c139e9cd91985f356c7/ruff-0.14.11-py3-none-win32.whl", hash = "sha256:337c5dd11f16ee52ae217757d9b82a26400be7efac883e9e852646f1557ed841", size = 12851094, upload-time = "2026-01-08T19:11:45.163Z" },
- { url = "https://files.pythonhosted.org/packages/58/f1/90ddc533918d3a2ad628bc3044cdfc094949e6d4b929220c3f0eb8a1c998/ruff-0.14.11-py3-none-win_amd64.whl", hash = "sha256:f981cea63d08456b2c070e64b79cb62f951aa1305282974d4d5216e6e0178ae6", size = 14001379, upload-time = "2026-01-08T19:11:52.591Z" },
- { url = "https://files.pythonhosted.org/packages/c4/1c/1dbe51782c0e1e9cfce1d1004752672d2d4629ea46945d19d731ad772b3b/ruff-0.14.11-py3-none-win_arm64.whl", hash = "sha256:649fb6c9edd7f751db276ef42df1f3df41c38d67d199570ae2a7bd6cbc3590f0", size = 12938644, upload-time = "2026-01-08T19:11:50.027Z" },
+version = "0.15.16"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/a6/bd/5f7ec371001337d8fa61701c186ff8b613ecac1651848c5950f4c4d5f2e9/ruff-0.15.16.tar.gz", hash = "sha256:d05e78d38c78caf020b03789e25106c93017db5a0cb6e2819885018c61343b78", size = 4714267, upload-time = "2026-06-04T16:33:09.974Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/0c/42/53ef1c3953f157956db9bf7861e3bc50b9b887ce93300aa48cdba8336fe6/ruff-0.15.16-py3-none-linux_armv6l.whl", hash = "sha256:6ac3c0b3969cc6cf6b158c4e2f8f682acb58e7d700d8a44b65ecdc72d66ab0b2", size = 10709025, upload-time = "2026-06-04T16:32:51.935Z" },
+ { url = "https://files.pythonhosted.org/packages/93/9a/a79159346f19134a956607754e57d8d128f7a4c00f4ad2f7514d224c172c/ruff-0.15.16-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:197c207ed75ffba54a0dec23db4aa939a27a3053073e085e0042433cbdc58e4a", size = 11063550, upload-time = "2026-06-04T16:32:42.24Z" },
+ { url = "https://files.pythonhosted.org/packages/bc/72/3ce2ac000a5299ec238e01f51397b3b653c93b077d9b1bfe8715bb895f20/ruff-0.15.16-py3-none-macosx_11_0_arm64.whl", hash = "sha256:3a39fec45ab316cc23e7558f23fea4a70403ddb5648ea9a4a3854a16973d0071", size = 10421345, upload-time = "2026-06-04T16:32:37.251Z" },
+ { url = "https://files.pythonhosted.org/packages/b0/c2/cc7fad3ec9169373f5b6a18f1917b91080feec40c3f9658334a1d28e2f03/ruff-0.15.16-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba93191d79003116b95128c9d306e045200fdbd0bccb782b110f3cd1d4abc5cf", size = 10757217, upload-time = "2026-06-04T16:32:54.722Z" },
+ { url = "https://files.pythonhosted.org/packages/69/d2/3474009eaa0a65b31fa7152a2fad5e2f050c640ceb1e6b02ee6922e94c82/ruff-0.15.16-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c6ee4b90520630120ef032aa5cc10db483852dff950e78b1d717e2993a61ac8d", size = 10507035, upload-time = "2026-06-04T16:33:05.343Z" },
+ { url = "https://files.pythonhosted.org/packages/ca/81/b7ae6ccbd11f0c8dc3d5d67fc4be9b57ff57ca86ba56152021378e1277f2/ruff-0.15.16-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4e4215bc938bc3c8215c1472c1aa437e310fee20cd427335fec9d7e609563628", size = 11255291, upload-time = "2026-06-04T16:32:49.49Z" },
+ { url = "https://files.pythonhosted.org/packages/d9/e1/46e526f1a7cc90857ce6ddf25fbb77eb6568651ac38d71b033af07076dd5/ruff-0.15.16-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7c8d26be963b090f10e29abc8b3e74a2a321f6fa34e02424e30b5af89350ecbb", size = 12124922, upload-time = "2026-06-04T16:33:07.821Z" },
+ { url = "https://files.pythonhosted.org/packages/1a/da/5c791b088b596b24d0deb967fa28ae02ad751a140c0b9ea81c5ab915d6c0/ruff-0.15.16-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f198cf4123602a2280ed46c307bcbafe41758d6fee5b456b6b6058ca1514b3b4", size = 11332186, upload-time = "2026-06-04T16:33:02.971Z" },
+ { url = "https://files.pythonhosted.org/packages/72/11/5da87abe20047c8962361473923ebb2f62b595250126aadfad8c20649c1e/ruff-0.15.16-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb27515fa6240fb586ae82b901a59e67d24acff86f2190b433dc542fe0435aeb", size = 11373541, upload-time = "2026-06-04T16:32:47.007Z" },
+ { url = "https://files.pythonhosted.org/packages/fe/2a/8554754c23a854ae3fd6b507e36ad61ddb121e298c6d5d617dec94ed0f14/ruff-0.15.16-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:a267c46ba1593fc26b8eecbea050b39d40c0b6bb7781ee11c90a02cd10032951", size = 11353014, upload-time = "2026-06-04T16:32:34.795Z" },
+ { url = "https://files.pythonhosted.org/packages/62/25/62ea41529ec89f742ea3fed9cb1059c72877ec7cf9b9e99ac9cf3294d1d9/ruff-0.15.16-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:528c68f39a91498a8d50e91ff5985df3d105782bab49cc378e73ac26bff083e8", size = 10737467, upload-time = "2026-06-04T16:32:26.348Z" },
+ { url = "https://files.pythonhosted.org/packages/90/17/334d3ad9de4d40f9dd58fdd09e35ce64553bb501e2f19a839e2fb6be14fc/ruff-0.15.16-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:7ed55c58950df60589a9a7a5d2f8fa5f54ebd287163be805adfe6ee95a9de123", size = 10521910, upload-time = "2026-06-04T16:32:32.54Z" },
+ { url = "https://files.pythonhosted.org/packages/4d/bd/3ac7c6ae77a885c1004b3dda2446ea401768d24f851c14b4ad4b24f6639c/ruff-0.15.16-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d482feaf51512b50f9790ceb417a56a61dd1e9d9bf967662b9ed27c01b34f53a", size = 10979190, upload-time = "2026-06-04T16:32:57.492Z" },
+ { url = "https://files.pythonhosted.org/packages/33/d7/609546e6a413c3f216fbf2a50c928f97c80939154f6a0503114094a86191/ruff-0.15.16-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1e15bc8c94513dae2a40cc9ef07c94fdd4ecc9e29dabebeebe170f952322c9e3", size = 11477014, upload-time = "2026-06-04T16:32:44.687Z" },
+ { url = "https://files.pythonhosted.org/packages/74/0d/f2cd247ad32633a5c36e97141a2c21b11c6279f7957bc2ff360b1e08fddd/ruff-0.15.16-py3-none-win32.whl", hash = "sha256:580378f7bd4aa25f72e74aa54948a9622f142b1e509521dd10902e886681cc1e", size = 10735541, upload-time = "2026-06-04T16:32:30.145Z" },
+ { url = "https://files.pythonhosted.org/packages/8b/9e/02e845ef151b1dee585e55c4739f8e1734ae1d9f1221dff65761c162208b/ruff-0.15.16-py3-none-win_amd64.whl", hash = "sha256:408256017284eddf98fff77b29aa4fb30f586042d535b2d9befc6512f400aaec", size = 11843403, upload-time = "2026-06-04T16:32:39.76Z" },
+ { url = "https://files.pythonhosted.org/packages/15/19/016553f86f207450aebebc2b2b5088d086b901cc8186c02ac4284db3bd88/ruff-0.15.16-py3-none-win_arm64.whl", hash = "sha256:8cd61783afb39638a7133ef0d2dfb1e91277593962f81b5a8423eb0b888a6121", size = 11134555, upload-time = "2026-06-04T16:33:00.136Z" },
]
[[package]]