From d5e84dccbd4ab0f0afef7e1881351daa2cf3d58e Mon Sep 17 00:00:00 2001 From: Mike Gouline <1960272+gouline@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:27:13 +1100 Subject: [PATCH] fix: unicode exposure slugs --- dbtmetabase/_exposures.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dbtmetabase/_exposures.py b/dbtmetabase/_exposures.py index f37c489..1fba772 100644 --- a/dbtmetabase/_exposures.py +++ b/dbtmetabase/_exposures.py @@ -15,6 +15,7 @@ Sequence, Tuple, ) +from urllib.parse import unquote from dbtmetabase.metabase import Metabase @@ -109,7 +110,11 @@ def dbname(details: Mapping) -> str: exclude_personal=not allow_personal_collections ): collection_name = collection["name"] - collection_slug = collection.get("slug", safe_name(collection["name"])) + + if "slug" in collection: + collection_slug = unquote(collection["slug"]) + else: + collection_slug = safe_name(collection["name"]) if not collection_filter.match(collection_name): _logger.debug("Skipping collection '%s'", collection["name"])