From 7ab294a41d8dbb82b1ef5781ca12669632e760c7 Mon Sep 17 00:00:00 2001 From: Robbie Coomber Date: Sat, 21 Dec 2024 23:02:12 +0000 Subject: [PATCH] Fix circular imports --- posthog/hogql/database/schema/sessions_v1.py | 3 ++- posthog/hogql/database/schema/sessions_v2.py | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/posthog/hogql/database/schema/sessions_v1.py b/posthog/hogql/database/schema/sessions_v1.py index f3c167dcb227c..298a96a70d41d 100644 --- a/posthog/hogql/database/schema/sessions_v1.py +++ b/posthog/hogql/database/schema/sessions_v1.py @@ -22,7 +22,6 @@ ChannelTypeExprs, DEFAULT_CHANNEL_TYPES, ) -from posthog.hogql.database.schema.sessions_v2 import DEFAULT_BOUNCE_RATE_DURATION_SECONDS from posthog.hogql.database.schema.util.where_clause_extractor import SessionMinTimestampWhereClauseExtractorV1 from posthog.hogql.errors import ResolutionError from posthog.models.property_definition import PropertyType @@ -36,6 +35,8 @@ if TYPE_CHECKING: from posthog.models.team import Team +DEFAULT_BOUNCE_RATE_DURATION_SECONDS = 10 + RAW_SESSIONS_FIELDS: dict[str, FieldOrTable] = { "id": StringDatabaseField(name="session_id"), # TODO remove this, it's a duplicate of the correct session_id field below to get some trends working on a deadline diff --git a/posthog/hogql/database/schema/sessions_v2.py b/posthog/hogql/database/schema/sessions_v2.py index aee627f294546..66bfae2d3952d 100644 --- a/posthog/hogql/database/schema/sessions_v2.py +++ b/posthog/hogql/database/schema/sessions_v2.py @@ -22,7 +22,7 @@ ChannelTypeExprs, DEFAULT_CHANNEL_TYPES, ) -from posthog.hogql.database.schema.sessions_v1 import null_if_empty +from posthog.hogql.database.schema.sessions_v1 import null_if_empty, DEFAULT_BOUNCE_RATE_DURATION_SECONDS from posthog.hogql.database.schema.util.where_clause_extractor import SessionMinTimestampWhereClauseExtractorV2 from posthog.hogql.errors import ResolutionError from posthog.hogql.modifiers import create_default_modifiers_for_team @@ -38,8 +38,6 @@ from posthog.models.team import Team -DEFAULT_BOUNCE_RATE_DURATION_SECONDS = 10 - RAW_SESSIONS_FIELDS: dict[str, FieldOrTable] = { "session_id_v7": IntegerDatabaseField(name="session_id_v7"), "team_id": IntegerDatabaseField(name="team_id"),