From 7ff51c8ec3d5a425bc86593dfa26f16d4ba03d35 Mon Sep 17 00:00:00 2001 From: Dan Snow <31494343+dfsnow@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:50:05 -0500 Subject: [PATCH] Remove prefix underscore from slugified schema names (#91) * Remove prefix underscore from schema names * Remove leading number test call --- dbt/macros/slugify.sql | 3 --- dbt/macros/tests/test_slugify.sql | 11 ----------- 2 files changed, 14 deletions(-) diff --git a/dbt/macros/slugify.sql b/dbt/macros/slugify.sql index 07eae5dce..35c6a8c47 100644 --- a/dbt/macros/slugify.sql +++ b/dbt/macros/slugify.sql @@ -9,8 +9,5 @@ {#- Only take letters, numbers, and hyphens -#} {% set string = modules.re.sub("[^a-z0-9-]+", "", string) %} - {#- Prepends "_" if string begins with a number -#} - {% set string = modules.re.sub("^[0-9]", "_" + string[0], string) %} - {{ return(string) }} {% endmacro %} diff --git a/dbt/macros/tests/test_slugify.sql b/dbt/macros/tests/test_slugify.sql index a6f66a968..55dc25ace 100644 --- a/dbt/macros/tests/test_slugify.sql +++ b/dbt/macros/tests/test_slugify.sql @@ -6,7 +6,6 @@ {% do test_kebab_slugify_replaces_slashes() %} {% do test_kebab_slugify_replaces_underscores() %} {% do test_kebab_slugify_removes_special_characters() %} - {% do test_kebab_slugify_handles_leading_numbers() %} {% endmacro %} {% macro test_kebab_slugify_lowercases_strings() %} @@ -52,13 +51,3 @@ ) }} {% endmacro %} - -{% macro test_kebab_slugify_handles_leading_numbers() %} - {{ - assert_equals( - "test_kebab_slugify_handles_leading_numbers", - kebab_slugify("123test"), - "_123test", - ) - }} -{% endmacro %}