Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use slashes in folder names instead of division slashes added by Gazer #153

Merged
merged 5 commits into from
Dec 4, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
drstrangelooker marked this conversation as resolved.
Show resolved Hide resolved
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", "/")
drstrangelooker marked this conversation as resolved.
Show resolved Hide resolved

logger.debug("parent_id to use", extra={"id_tracker": id_tracker})
# Pull last value from id_tracker
space_parent = id_tracker.pop()
Expand Down
Loading