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.

fix(ducklake): default inlining off in configure_connection (#65279)

Jakob Homanc3e6b2eec14a
diff --git a/posthog/ducklake/storage.py b/posthog/ducklake/storage.py
index 7361532e4ad4..af2af662ec40 100644
--- a/posthog/ducklake/storage.py
+++ b/posthog/ducklake/storage.py
@@ -346,6 +346,13 @@ def configure_connection(
conn.execute("INSTALL delta")
conn.execute("LOAD ducklake")
+ # Default inlining off. DuckLake's per-catalog `data_inlining_row_limit`
+ # is cached in-memory at ATTACH time and never refreshed, so a SET on
+ # `ducklake_metadata` doesn't reach long-lived workers. Setting the
+ # session-level fallback here lets every connection default to no
+ # inlining regardless of when the underlying worker first ATTACHed the
+ # catalog (see ducklake_catalog.cpp DataInliningRowLimit lookup order).
+ conn.execute("SET ducklake_default_data_inlining_row_limit = 0")
conn.execute("LOAD httpfs")
conn.execute("LOAD delta")
conn.execute(storage_config.to_duckdb_secret_sql())
@@ -401,6 +408,8 @@ def configure_cross_account_connection(
conn.execute("INSTALL delta")
conn.execute("LOAD ducklake")
+ # See configure_connection for why this session-level fallback is set.
+ conn.execute("SET ducklake_default_data_inlining_row_limit = 0")
conn.execute("LOAD httpfs")
conn.execute("LOAD delta")
diff --git a/products/data_modeling/backend/models/datawarehouse_saved_query.py b/products/data_modeling/backend/models/datawarehouse_saved_query.py
index 3a7ac8deeb58..94e415c2baf5 100644
--- a/products/data_modeling/backend/models/datawarehouse_saved_query.py
+++ b/products/data_modeling/backend/models/datawarehouse_saved_query.py
@@ -194,7 +194,7 @@ class DataWarehouseSavedQuery(CreatedMetaFields, UUIDTModel, UpdatedMetaFields,
sync_saved_query_workflow(self, create=not schedule_exists)
except Exception as e:
capture_exception(e, {"saved_query_id": self.id, "saved_query_name": self.name})
- logger.warning(
+ logger.exception(
"failed_to_schedule_saved_query",
team_id=self.team_id,
saved_query_id=str(self.id),