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

Remove prefix underscore from slugified schema names #91

Merged
merged 3 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
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 %}