-
Notifications
You must be signed in to change notification settings - Fork 504
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
Add regex to star #466
Add regex to star #466
Conversation
I'm having some issues testing this from the instructions in the When I try to
Should the profile How can I fix this so I can test my PR. Thanks! |
@robertdefilippi have a look at the https://github.com/dbt-labs/dbt-utils/blob/main/run_test.sh script which is triggered by Circle. It looks like the profile is populated by copying from I just tried to look at the webhook history for this, but GitHub only retains them for a month. Could you push something else up to this PR branch? I think that should trigger another webhook and then I can see what happens after that. I'm broadly on board with bringing this in though, once we get the tests working 👍 |
@joellabes Just pushed a changed. Would love to figure out what the issues is 😄 |
OK I've opened an issue with circle ci's support team - the webhook was rejected but I don't know why :( |
Not a problem @joellabes ! This has been sitting for a month, so a little longer won't be an issue. Thank you for looking into this 😃 |
OK I heard back from them! Sounds like if you try again it'll work? 🤞
|
Looks like that worked! Looks like I'll have to keep an eye out on my circle-ci account from now on. Thanks for your help @joellabes Now I just need to fix these errors 👍 |
@joellabes finally got this all figured out 🙂 Thanks for all your help through this! |
Hurrah! I'll check it out start of next week 🔜 |
@robertdefilippi sorry for the slow moving here! My current plan is to ship 0.8.1 tomorrow-ish, and then include your changes in 0.9.0 of utils sometime after that (because the change of method signature will be a breaking change for anyone using positional arguments), which will be a wee way away because it will also be where we pull some stuff out of utils as discussed in #487 Fair warning, 0.8.1 includes a fair bit of movement around the star macro - shouldn't be insurmountable but I think you'll find some merge conflicts sorry. It'd be worth changing the target branch to |
@joellabes got it! Thanks for all your help so far, and the heads up with the potential changes coming my way 😄 Once 8.1 is out I'll have a go and fixing the conflicts. |
* Update README.md * add some flexibility to expression_is_true execution plan and add a few new tests * catch duplicate field name exception when the expression_is_true test is invoked * expression is true - rename seeds, format sql and get rid of dupe column handler from PR comments Co-authored-by: Joel Labes <joel.labes@dbtlabs.com>
macros/sql/star.sql
Outdated
{% macro star(from, relation_alias=False, except=[], regex='', prefix='', suffix='') -%} | ||
{{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, regex, prefix, suffix)) }} | ||
{% endmacro %} | ||
|
||
{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='') -%} | ||
{% macro default__star(from, relation_alias=False, except=[], regex='', prefix='', suffix='') -%} |
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.
I'd prefer to add the optional regex
argument to the end of the signature. That way, this new feature will be guaranteed to be non-breaking for all users.
Do you have any thoughts about the order of parameters?
I think the change would be as simple as the following:
{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', regex='') -%}
{{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, regex)) }}
{% endmacro %}
{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', regex='') -%}
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.
I'd prefer to add the optional regex argument to the end of the signature. That way, this new feature will be guaranteed to be non-breaking for all users.
Do you have any thoughts about the order of parameters?
See inline comments for suggested updates.
@dbeatty10 This fell off my radar for a bit, but you make a good suggestion. I'll have a look when I get some time. Thanks! |
…ils into add_regex_to_star
I'm going to close this PR and reopen with a fresh branch. |
This is a:
master
dev/
branchdev/
branchDescription & motivation
Adding regex functionality to
dbt_utils.star
Checklist
star()
source)limit_zero()
macro in place of the literal string:limit 0
dbt_utils.type_*
macros instead of explicit datatypes (e.g.dbt_utils.type_timestamp()
instead ofTIMESTAMP