Skip to content

Commit

Permalink
Merge pull request #152 from sean-rose/fix-folder-slashes
Browse files Browse the repository at this point in the history
fix: Use slashes in folder names instead of division slashes added by Gazer
  • Loading branch information
drstrangelooker authored Dec 4, 2024
2 parents 3f0195a + 403347b commit 26c859b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions looker_deployer/commands/deploy_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -134,6 +138,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()
Expand Down

0 comments on commit 26c859b

Please sign in to comment.