: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(data-imports): replace a source _ph_debug column instead of duplicating it (#124759)
Tom Owers601e31d6b98a
diff --git a/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/arrow_utils.py b/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/arrow_utils.pyindex 22706f23e6df..fe4e6ba7ee88 100644--- a/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/arrow_utils.py+++ b/products/warehouse_sources/backend/temporal/data_imports/pipelines/core/arrow_utils.py@@ -470,6 +470,9 @@ def _append_debug_column_to_pyarrows_table(table: pa.Table, load_id: int) -> pa.debug_info = f'{{"load_id": {load_id}}}'column = pa.array([debug_info] * table.num_rows, type=pa.string())+ # Source data can already carry `_ph_debug`, e.g. files written by an earlier PostHog sync.+ if "_ph_debug" in table.column_names:+ return table.set_column(table.schema.get_field_index("_ph_debug"), "_ph_debug", column)return table.append_column("_ph_debug", column)