-
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-1585] [Feature] New top level commands: interactive preview #6359
Comments
A lot of community interest in this one! :) #5418, #6087, #6090 Mostly the same comments as in #6358 (comment). I do think a totally new command for this one makes sense. It would work much the same as interactive compile, with the added step of actually executing the compiled query. $ dbt preview --code <base64encoded> From the CLI perspective, this should feel much the same as: -- macros/preview.sql
{% macro preview(code) %}
{% set result = run_query(code) %}
{% do result.print_table() %}
{% endmacro %}
formatting + passing the resultIn the existing implementation,
For programmatic consumers ( limiting result set
Hm. I'm not 100% sure that this should be in The default should either be:
Options on how to implement:
Let's keep thinking through this part. I think it can be out of scope for the initial first-pass implementation. |
In my head, the question comes down to 'should we modify user code directly?' And if so (the IDE does today), where in the stack should that happen. My guess is Core is the right place long term. That will make extending interactive preview/compile support to Python (if that's even doable) a bit easier, as we won't have multiple components needing to understand user code. I'm thinking the IDE shouldn't know about anything related to dbt code parsing itself. |
@isaac-taylor Agreed. We can discuss this more offline — what's your + @bossnunta's appetite to have a "Limit [500]" checkbox in the IDE again? That's probably the right UX, if what we're doing is passing a |
Seems like just a missing feature from 1.1 that we had in 1.0. Very doable from a technical perspective. It's about UX and prioritization I think Let me bring that one up to Nate to see if that's on his radar. |
I think having a version of "limit [500]" as a UX (and/or centralized admin configuration) is a very good approach here. I don't believe we had that in IDE v1.0 either. I shared notes on this in Slack. (What we do in both 1.0 and 1.1 is the default to 500 rows that is overridden when you have a limit clause). However, from product perspective, the IDE shouldn't really be doing sql parsing to deal with this in my opinion. Ideally we could do this with |
If we have a checkbox, we don't need to do SQL parsing at all, anywhere. Ideal! It will be on the user to either:
|
Just for historical record, we did at one time have a "limit 500" checkbox in cloud IDE v1.0, until we merged https://github.com/dbt-labs/dbt-cloud/pull/2284. Looking at the PR and the issue it closes, it is lost to history precisely why we made this change. I do know that it was unpopular with some folks though and I am more than happy to go back to a checkbox style approach. In my memory, the biggest reason for the change was the amount of UI real estate that the checkbox took up. It seemed to mismatch how "primary" we thought this functionality should be. |
As in #6358 (comment), we'd also want the ability to "preview" a specific model, within the context of that model, to correctly resolve any instances of (e.g.)
The idea being, we compile Thinking about "compile" and "preview" in the dbt Cloud IDE: Who should be responsible for determining if the user is compiling/preview a specific model in the project, versus some arbitrary Jinja-SQL in a scratchpad? Should the IDE detect that the file open is an actual saved file in the project? Should it pass along the file name, in addition to file contents, and |
The way I would naively expect this to work is for dbt itself to support two different mutually exclusive flags for the two use cases. Then I would expect it to be the job of clients to determine which case they are in and use the appropriate flag. Does that seem plausible? |
I'd agree with the last comment of 2 different flags/options. In BigQuery, the |
Thanks @b-per! Two comments that came up in our related conversation just now:
To be clear, I think both of those should be out of scope for the initial implementation (this issue). But it's good to have these potential (adapter-specific) extensions in the back of our minds, while doing the work to add + expose this foundational capability. |
Not something addressed previously in this issue, and definitely out of scope for the first iteration: Previewing transformations written in Python. On some platforms, this would require writing the final How to know if it's Python?
|
@jtcohen6 it's not uncommon for enterprise users to request the ability to disable preview in the IDE. would it be worth having a project-level setting with override flag we pass through to dbt Server and into Cloud? then they could have that as an option and always pass the override into their dbt commands |
@lostmygithubaccount To me, |
Per BLG 2/6/23 @aranke What is the desired behavior for CLI usage wrt above, can you double check it with Doug / Jeremy? |
Run is not needed. |
Acceptance criteria for ticket:
Nice to have:
|
Describe the feature
See #6358 for more background of what interactive means.
This one is for supporting interactive preview function as a native function for dbt cli. Example of how this happens in dbt-rpc and dbt-server(link to actual code)
AC:
See last comment
The text was updated successfully, but these errors were encountered: