From 74be4037c814912d18aeef34242cd5b136ff031f Mon Sep 17 00:00:00 2001 From: Eric Duong Date: Thu, 20 Jun 2024 17:32:33 -0400 Subject: [PATCH] fix(data-warehouse): restore folder path logic (#23133) * restore folder path logic * too many lines --- posthog/warehouse/models/external_data_job.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posthog/warehouse/models/external_data_job.py b/posthog/warehouse/models/external_data_job.py index e9504686d560d3..0b40c41f11069d 100644 --- a/posthog/warehouse/models/external_data_job.py +++ b/posthog/warehouse/models/external_data_job.py @@ -33,7 +33,10 @@ class Status(models.TextChoices): @property def folder_path(self) -> str: - return f"team_{self.team_id}_{self.pipeline.source_type}_{str(self.schema_id)}".lower().replace("-", "_") + if self.schema and self.schema.is_incremental: + return f"team_{self.team_id}_{self.pipeline.source_type}_{str(self.schema.pk)}".lower().replace("-", "_") + + return f"team_{self.team_id}_{self.pipeline.source_type}_{str(self.pk)}".lower().replace("-", "_") def url_pattern_by_schema(self, schema: str) -> str: if TEST: