-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-109] [Feature] Show a hint in the error message when trying to access the graph whenever execute = False #4641
Comments
I'm closing out comments on the metrics package's PR and didn't want this to get lost:
|
Some wild-eyed experimentation with what a There are two main goals here:
I'm going to open a PR against the This also helped me get to the bottom of some weird issues that @joellabes and I had been seeing months ago, whereby a nested/unparsed
It raises an interesting dilemma:
You can actually get it working by explicitly specifying the underlying model reference: -- models/my_model.sql
-- depends on: {{ ref('dim_customers') }}
select *
from {{ metrics.metric(
metric_name='new_customers',
grain='week',
dimensions=['plan', 'country']
) }} Does that even feel so wrong? The DAG lineage kinda works, doesn't it? Or should we make it possible for a model to Note: Still need to confirm the behavior when running via new |
I think it's reasonable for now! Bonus: by it being a bit of a pain in the butt, it may help to discourage people from assuming it's the default way to use the metrics package 😂 In the medium term, yeah I think we'll need to be able to calculate metrics on top of one another, but I don't know that it has to be materialised as a model in the middle. (Although given how grumpy Redshift gets when you nest too many CTEs deep, it might be important to have a table as a stabilising point in the middle). |
I haven't been able to confirm this by testing locally, but by reading through the codebase, I'm pretty sure this would be an issue. I've also convinced myself that it's a good thing the manual To that end, I've opened #4851. We'll need to make that change (or one like it) before we can implement the good version of |
The motivating ask here (metrics) will be resolved by #5027. Even though that doesn't resolve the initial ask per se—raising an error if |
Is there an existing feature request for this?
Describe the Feature
Today in "Joel wants better error messages":
execute
!This is a common tripwire - I trip over it myself about once a year.
Is there anything we can do when someone tries to do something that works in execute mode, but not during the first runthrough? The first thread I linked above was particularly insidious because when I tried to debug it by outputting inside of {{ curly braces }} it worked correctly
Describe alternatives you've considered
No response
Who will this benefit?
People writing their own introspective queries, or code that depends on the graph object (likely to become more popular, especially to access metric definitions etc)
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: