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
A common headache that I face with DBT is when a TypeError occurs during the Jinja rendering phase. Currently, when such errors arise, especially due to None values, it's challenging to identify where the problem lies. This is an old issue, and others have already complained about it, making it difficult to find the root cause in other problems see: dbt-labs-experimental-features/issues/37, #4596, #8276, #9033, etc.
also, this comment #4596 (comment)
Maybe TypeError should be kind of RuntimeError like this
Runtime Error in model ex2 (models/ex2.sql)
TypeError:'NoneType' object is not iterable
TypeError: Error in model ex2 (models/ex2.sql)
NoneType' object is not iterable
Example
-- models/my_model.sql
{% set mylist = None %}
{% for item in mylist %}
select '{{ item }}' as my_item
{{ 'union all' if not loop.last }}
{% endfor %}
The following approach is really bad. I believe we should just check for TypeError, raising a general DbtRuntimeError can mask the root cause of unexpected error
devmessias
changed the title
[Feature] When Jinja fails to render a model due TypeError should display the model and line number.
[Feature] When Jinja fails to render a model due TypeError should raise an exception with the node information
Oct 15, 2024
Is this your first time submitting a feature request?
Describe the feature
A common headache that I face with DBT is when a TypeError occurs during the Jinja rendering phase. Currently, when such errors arise, especially due to None values, it's challenging to identify where the problem lies. This is an old issue, and others have already complained about it, making it difficult to find the root cause in other problems see: dbt-labs-experimental-features/issues/37, #4596, #8276, #9033, etc.
also, this comment
#4596 (comment)
Maybe TypeError should be kind of RuntimeError like this
Example
Describe alternatives you've considered
The following approach is really bad. I believe we should just check for TypeError, raising a general DbtRuntimeError can mask the root cause of unexpected error
Who will this benefit?
everyone who spend minutes or hours trying to fix an issue due the billion dolar mistake
https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/
Are you interested in contributing this feature?
yes
Anything else?
No response
The text was updated successfully, but these errors were encountered: