You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this feature
I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion
Describe the feature
Create dbt.var.get() for python models to retrieve project variables without requiring yaml file.
I am narrowly requesting a var feature. However, this can be a small part of a larger initiative to get python at parity with SQL.
Describe alternatives you've considered
Here is a loom walking through the today solution.
The tl;dr is that python models don't have an argument such as dbt.var.get(). We have a dbt.config.get() but that argument is specific to each model (not global). What we need to do today:
Give the model a passthrough variable for example, run_frequency.
Make a model specific yaml for your python model. This is really we need to do all python model configs if we want SQL parity.
Define the default you want, in this case 'Daily' in the dbt_project.yml.
Pass the variable override in the command line as usual, in our example, 'Weekly'. So dbt run -s model_name --vars '{"run_frequency": "Weekly"}'
Who will this benefit?
Our user base that is using python. I realize this is not the majority of users, but it would boost the python experience up to reduce the user experience and ergonomics divide between python and SQL in dbt.
Are you interested in contributing this feature?
Yes, I can be a tester.
Anything else?
No response
The text was updated successfully, but these errors were encountered:
One challenge with adopting Python models is the limitations as you describe here, as well as PR like #8538. At my previous job, I was able to advocate for Python models due PySpark and able to test transformations, but it wasn’t without costs, as I encountered some limitations.
If @hope-wat can help with testing, I’d be happy to help implement this. I have some experience with how Python models work, because of #6317 and #8538.
Is this your first time submitting a feature request?
Describe the feature
Create dbt.var.get() for python models to retrieve project variables without requiring yaml file.
I am narrowly requesting a var feature. However, this can be a small part of a larger initiative to get python at parity with SQL.
Describe alternatives you've considered
Here is a loom walking through the today solution.
The tl;dr is that python models don't have an argument such as dbt.var.get(). We have a dbt.config.get() but that argument is specific to each model (not global).
What we need to do today:
run_frequency
.'Daily'
in thedbt_project.yml
.'Weekly'
. Sodbt run -s model_name --vars '{"run_frequency": "Weekly"}'
Who will this benefit?
Our user base that is using python. I realize this is not the majority of users, but it would boost the python experience up to reduce the user experience and ergonomics divide between python and SQL in dbt.
Are you interested in contributing this feature?
Yes, I can be a tester.
Anything else?
No response
The text was updated successfully, but these errors were encountered: