From 38d6611657be2eb768d1e557c77cbeb0c103d168 Mon Sep 17 00:00:00 2001 From: Kevin Schenk Date: Sun, 22 Dec 2024 13:07:22 -0500 Subject: [PATCH 1/3] Update snowfakery.py to fix #3859 --- cumulusci/tasks/bulkdata/snowfakery.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cumulusci/tasks/bulkdata/snowfakery.py b/cumulusci/tasks/bulkdata/snowfakery.py index 1125714ca0..c0ca41eaa3 100644 --- a/cumulusci/tasks/bulkdata/snowfakery.py +++ b/cumulusci/tasks/bulkdata/snowfakery.py @@ -1,3 +1,4 @@ +import os import shutil import time import typing as T @@ -583,8 +584,10 @@ def _generate_and_load_initial_batch(self, working_directory: Path): self.sets_finished_while_generating_template = num_records new_template_dir = data_loader_new_directory_name(template_dir, self.run_until) - shutil.move(template_dir, new_template_dir) - template_dir = new_template_dir + # don't rename path if new_template_dir matches template_dir + if os.path.abspath(template_dir) != os.path.abspath(new_template_dir): + shutil.move(template_dir, new_template_dir) + template_dir = new_template_dir # don't send data tables to child processes. All they # care about are ID->OID mappings From 8e8a8db8de03f39dd070bbfbcf7f17920d56a302 Mon Sep 17 00:00:00 2001 From: Kevin Schenk Date: Wed, 15 Jan 2025 19:27:19 -0500 Subject: [PATCH 2/3] Updated code to use Path library instead of os --- cumulusci/tasks/bulkdata/snowfakery.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cumulusci/tasks/bulkdata/snowfakery.py b/cumulusci/tasks/bulkdata/snowfakery.py index c0ca41eaa3..ba6414053a 100644 --- a/cumulusci/tasks/bulkdata/snowfakery.py +++ b/cumulusci/tasks/bulkdata/snowfakery.py @@ -1,4 +1,3 @@ -import os import shutil import time import typing as T @@ -584,8 +583,8 @@ def _generate_and_load_initial_batch(self, working_directory: Path): self.sets_finished_while_generating_template = num_records new_template_dir = data_loader_new_directory_name(template_dir, self.run_until) - # don't rename path if new_template_dir matches template_dir - if os.path.abspath(template_dir) != os.path.abspath(new_template_dir): + # rename only if new_template_dir does not match template_dir + if Path(template_dir).resolve() != Path(new_template_dir).resolve(): shutil.move(template_dir, new_template_dir) template_dir = new_template_dir From 9e58960814ae06bca772c5fea6e3424236d1e387 Mon Sep 17 00:00:00 2001 From: James Estevez Date: Fri, 17 Jan 2025 13:03:08 -0800 Subject: [PATCH 3/3] Update cumulusci/tasks/bulkdata/snowfakery.py --- cumulusci/tasks/bulkdata/snowfakery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulusci/tasks/bulkdata/snowfakery.py b/cumulusci/tasks/bulkdata/snowfakery.py index ba6414053a..bef4e888cf 100644 --- a/cumulusci/tasks/bulkdata/snowfakery.py +++ b/cumulusci/tasks/bulkdata/snowfakery.py @@ -584,7 +584,7 @@ def _generate_and_load_initial_batch(self, working_directory: Path): new_template_dir = data_loader_new_directory_name(template_dir, self.run_until) # rename only if new_template_dir does not match template_dir - if Path(template_dir).resolve() != Path(new_template_dir).resolve(): + if template_dir.resolve() != new_template_dir.resolve(): shutil.move(template_dir, new_template_dir) template_dir = new_template_dir