diff --git a/posthog/warehouse/models/external_data_job.py b/posthog/warehouse/models/external_data_job.py index e9504686d560d..0b40c41f11069 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: