-
Notifications
You must be signed in to change notification settings - Fork 71
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
feature/add new model fct_hard_coded_references to capture all models that have hard coded references #246
Conversation
As Joel mentioned in another issue, would it make sense to load the regexes from another package (and then should they be in |
Hmm - I think it could make sense to load regexes from another package but this model vs. codegen use different regexes with some overlap. Might be worth brainstorming what exactly the regex macros should look like, since these two use cases are different. Would also worry about version dependency if someone installed both this package and codegen, but those packages had different versions of a regex package installed. Is this blocking? Or do you want me to open up a new issue for this package & codgen but continue finalizing this PR? |
Tagging @joellabes who might have good advice here :) |
If they're similar but not the same, trying to shoehorn them into the same behaviour is probably a bad idea.
If you're going to do this, I'd rather its own package - codegen shouldn't have any direct relationship to project-evaluator. IMO you could continue with it duplicated, but if you have a third use case where this comes up then extracting it probably makes sense. Very unscientific heuristics here so feel free to disagree! |
macros/find_all_raw_references.sql
Outdated
# second matching group | ||
# opening {{, 0 or more whitespace character(s), var, 0 or more whitespace character(s), an opening parenthesis, 0 or more whitespace character(s), 1 or 0 quotation mark | ||
({{\s*var\s*\(\s*[\'\"]?) |
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.
So beautiful ❤️
README.md
Outdated
<details> | ||
<summary><b>Example</b></summary> | ||
|
||
blah blah |
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.
Agree 👍
It looks great and super useful. |
README.md
Outdated
<details> | ||
<summary><b>Exceptions</b></summary> | ||
|
||
TO DO: Are there any exceptions anyone can think of?? I think there might be some packages that select from a variable... |
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.
Should we remove the TODO?
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.
yes, but this is an open question - can you think of any exceptions?
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.
No, and if there is any, then people will just use the seed file I guess
Looks good to me overall. I added a comment about the TODO in the README and we just need to get databricks passing as well. |
@@ -0,0 +1,3 @@ | |||
{% macro spark__escape_single_quotes(expression) -%} |
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.
This should eventually be added to the spark adapter!
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'm honestly floored by the whitespace issue adding spaces
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 Grace! LGTM 🥐
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.
great work! -- stray thought: is this in service of replacing our current fct_root_models
check? I feel like the overlap here would be really close to 100%
name: equality_fct_hard_coded_references | ||
compare_model: ref('fct_hard_coded_references') | ||
compare_columns: |
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.
nit: since the compare columns are all the columns, we can just leave out this config
@@ -0,0 +1,3 @@ | |||
{% macro spark__escape_single_quotes(expression) -%} |
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'm honestly floored by the whitespace issue adding spaces
This is a:
Link to Issue
Closes #240 and #189
Description & motivation
Create a new model
fct_hard_coded_references
that captures all models that have hard coded reference(s) in their raw sqlTO DO:
Integration Test Screenshot
Checklist