-
Notifications
You must be signed in to change notification settings - Fork 501
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
Handle empty strings in slugify macro #774
Handle empty strings in slugify macro #774
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @atvaccaro! Looks good, one suggestion to make it a bit more robust
This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days. |
Can we merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to merge this, need to resolve a merge conflict first. I'm gonna try a thing or two to accomplish that.
|
||
## Contributors: | ||
@Harmuth94, [#768](https://github.com/dbt-labs/dbt-utils/issues/768) | ||
|
||
@atvaccaro, [#773](https://github.com/dbt-labs/dbt-utils/issues/773) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atvaccaro, [#773](https://github.com/dbt-labs/dbt-utils/issues/773) |
@@ -11,10 +11,11 @@ | |||
# Unreleased | |||
## Fixes | |||
- get_relations_by_pattern for Databricks connection with Unity catalog #768 ([#768](https://github.com/dbt-labs/dbt-utils/issues/768), [#769](https://github.com/dbt-labs/dbt-utils/pull/769)) | |||
- Handle empty strings in slugify macro #773 ([#773](https://github.com/dbt-labs/dbt-utils/issues/773), [#774](https://github.com/dbt-labs/dbt-utils/pull/774)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a merge conflict that we need to resolve in CHANGELOG.md.
I wasn't able to push to the remote for some reason, so I'm going to try to remove these changes in order to resolve the merge conflict.
- Handle empty strings in slugify macro #773 ([#773](https://github.com/dbt-labs/dbt-utils/issues/773), [#774](https://github.com/dbt-labs/dbt-utils/pull/774)) |
I wasn't able to resolve the merge conflict in this PR, presumably because "Allow edits from maintainers" isn't enabled on this fork. @atvaccaro I branched your original PR into #912 so that we can get your fixed merged. It's merged now, so I'm going to close this PR. Thanks for opening the original bug report and submitting a fix! 🏆 It will be included in the next release of dbt-utils. |
resolves #773
This is a:
All pull requests from community contributors should target the
main
branch (default).Description & motivation
As of the 1.0 release, slugify now prepends an underscore in the case of leading numbers. This throws an exception if the string is empty, but we can just return falsy strings without any modification.
Another option would be using a capture group or positive lookahead.
Checklist
star()
source)limit_zero()
macro in place of the literal string:limit 0
dbt.type_*
macros instead of explicit datatypes (e.g.dbt.type_timestamp()
instead ofTIMESTAMP