Skip to content

Commit

Permalink
Remove prefix underscore from slugified schema names (#91)
Browse files Browse the repository at this point in the history
* Remove prefix underscore from schema names

* Remove leading number test call
  • Loading branch information
dfsnow authored Aug 24, 2023
1 parent 0deb1c9 commit 7ff51c8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
3 changes: 0 additions & 3 deletions dbt/macros/slugify.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
11 changes: 0 additions & 11 deletions dbt/macros/tests/test_slugify.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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() %}
Expand Down Expand Up @@ -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 %}

0 comments on commit 7ff51c8

Please sign in to comment.