From 919ced5471bcf923623272e25d0b8e87692213d5 Mon Sep 17 00:00:00 2001 From: Tom Owers Date: Thu, 23 May 2024 13:33:23 +0100 Subject: [PATCH] chore(data-warehouse): Commented out data deletion (#22460) Commented out data deletion --- .../warehouse/data_load/validate_schema.py | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/posthog/warehouse/data_load/validate_schema.py b/posthog/warehouse/data_load/validate_schema.py index f3314ee5ab55b9..504d693ca7a082 100644 --- a/posthog/warehouse/data_load/validate_schema.py +++ b/posthog/warehouse/data_load/validate_schema.py @@ -13,7 +13,6 @@ ) from posthog.warehouse.models import ( - get_latest_run_if_exists, get_or_create_datawarehouse_credential, DataWarehouseTable, DataWarehouseCredential, @@ -115,7 +114,6 @@ async def validate_schema_and_update_table( logger = await bind_temporal_worker_logger(team_id=team_id) job: ExternalDataJob = await get_external_data_job(job_id=run_id) - last_successful_job: ExternalDataJob | None = await get_latest_run_if_exists(team_id, job.pipeline_id) credential: DataWarehouseCredential = await get_or_create_datawarehouse_credential( team_id=team_id, @@ -197,6 +195,11 @@ async def validate_schema_and_update_table( f"Data Warehouse: No data for schema {_schema_name} for external data job {job.pk}", exc_info=err, ) + else: + logger.exception( + f"Data Warehouse: Unknown ServerException {job.pk}", + exc_info=err, + ) except Exception as e: # TODO: handle other exceptions here logger.exception( @@ -204,14 +207,15 @@ async def validate_schema_and_update_table( exc_info=e, ) - if ( - last_successful_job - and _schema_name not in PIPELINE_TYPE_INCREMENTAL_ENDPOINTS_MAPPING[job.pipeline.source_type] - ): - try: - last_successful_job.delete_data_in_bucket() - except Exception as e: - logger.exception( - f"Data Warehouse: Could not delete deprecated data source {last_successful_job.pk}", - exc_info=e, - ) + # TODO: figure out data deletes - currently borked right now + # if ( + # last_successful_job + # and _schema_name not in PIPELINE_TYPE_INCREMENTAL_ENDPOINTS_MAPPING[job.pipeline.source_type] + # ): + # try: + # last_successful_job.delete_data_in_bucket() + # except Exception as e: + # logger.exception( + # f"Data Warehouse: Could not delete deprecated data source {last_successful_job.pk}", + # exc_info=e, + # )