-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: add dbt_picker_upstream and dbt_picker_downstream for relative model selection #35
base: main
Are you sure you want to change the base?
Conversation
Closes #34 |
Just had the thought that we could prompt the user for a "select" argument, possibly with the current buffer pre-populated. |
Nice! The basics seem to be working for me. One note is that it seems to also be picking up data tests as well as models. I'd prefer only models by default. Unfortunately, these pickers are the main things I want to use this extension for and they are wayyyy to slow to be useful at the moment (even the existing all model picker). |
Good catch, I fixed it in this commit: 3f7594f. There was an issue with how I was using Totally agree on performance. My first thought on caching was that we would store the upstream / downstream models when the picker is used, and then invalidate the cache if a model in the cache were modified. But this wouldn't account for creating a new model. Caching might not be a tricky one... 🤔 |
Have you tried passing |
This project is quite small, so it may not be a good representation of performance, but the time is comparable. Note the log statement that there was no saved manifest so it's a full parse on the first run (1.560s), and then partial on the second (1.336s).
When I'm on my other computer I can test a real-world project; would be curious what you get too! |
Introduces
dbt_picker_upstream
anddbt_picker_downstream
Telescope pickers.Makes use of the
--select
option of thedbt ls
command. By passing in the relative file path, to the dbt project, of the current buffer, we can determine the upstream and downstream models with either a prefix or suffix+
.Definitely open to feedback on the implementation, I think it might be possible for us to implement a generic solution where the user can provide the
--select
syntax themselves, and_picker
might be able to be cleaned up a bit more.