From aed8181b1e71af628f9ee9dff0a2e5ef89fb36f1 Mon Sep 17 00:00:00 2001 From: Sean Rose Date: Wed, 4 Dec 2024 09:01:04 -0800 Subject: [PATCH 1/3] Use slashes in folder names instead of division slashes added by Gazer. --- looker_deployer/commands/deploy_content.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/looker_deployer/commands/deploy_content.py b/looker_deployer/commands/deploy_content.py index 853dcc0..b3324a7 100644 --- a/looker_deployer/commands/deploy_content.py +++ b/looker_deployer/commands/deploy_content.py @@ -134,6 +134,9 @@ def build_spaces(spaces, sdk): id_tracker = ["0"] for space in spaces: + # Gazer replaces slashes in folder names with division slashes (Unicode character 2215), so undo that. + space = space.replace("\u2215", "/") + logger.debug("parent_id to use", extra={"id_tracker": id_tracker}) # Pull last value from id_tracker space_parent = id_tracker.pop() From 403347bc71d444600d6afc102f83a63fbf7176ac Mon Sep 17 00:00:00 2001 From: Sean Rose Date: Wed, 4 Dec 2024 09:51:35 -0800 Subject: [PATCH 2/3] Fall back to checking for previously imported folders where slashes might have been replaced with division slashes. --- looker_deployer/commands/deploy_content.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/looker_deployer/commands/deploy_content.py b/looker_deployer/commands/deploy_content.py index b3324a7..75ba44d 100644 --- a/looker_deployer/commands/deploy_content.py +++ b/looker_deployer/commands/deploy_content.py @@ -50,6 +50,10 @@ def create_or_return_space(space_name, parent_id, sdk): try: target_id = get_space_ids_from_name(space_name, parent_id, sdk) + if len(target_id) == 0 and "/" in space_name: + # If the folder name contains slashes then also check if it was previously imported with + # the slashes replaced with division slashes (Unicode character 2215) prior to PR #152. + target_id = get_space_ids_from_name(space_name.replace("/", "\u2215"), parent_id, sdk) logger.debug("Space ID from name", extra={"id": target_id}) assert len(target_id) == 1 except AssertionError as e: From 5f6b2e5e66397180ea700d97060cde986000bf5b Mon Sep 17 00:00:00 2001 From: "Dr. Strangelove" Date: Wed, 4 Dec 2024 13:27:01 -0500 Subject: [PATCH 3/3] Update PR number Co-authored-by: Sean Rose <1994030+sean-rose@users.noreply.github.com> --- looker_deployer/commands/deploy_content.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/looker_deployer/commands/deploy_content.py b/looker_deployer/commands/deploy_content.py index 75ba44d..593b6e3 100644 --- a/looker_deployer/commands/deploy_content.py +++ b/looker_deployer/commands/deploy_content.py @@ -52,7 +52,7 @@ def create_or_return_space(space_name, parent_id, sdk): target_id = get_space_ids_from_name(space_name, parent_id, sdk) if len(target_id) == 0 and "/" in space_name: # If the folder name contains slashes then also check if it was previously imported with - # the slashes replaced with division slashes (Unicode character 2215) prior to PR #152. + # the slashes replaced with division slashes (Unicode character 2215) prior to PR #153. target_id = get_space_ids_from_name(space_name.replace("/", "\u2215"), parent_id, sdk) logger.debug("Space ID from name", extra={"id": target_id}) assert len(target_id) == 1