Runtime Error 'NoneType' object has no attribute 'find_generate_macro_by_name'
See original GitHub issueExpected behavior
When trying to run any jinja templated SQL, the extension is able to compile the SQL and run the query correctly against the data warehouse
Actual behavior
When trying to run any jinja templated SQL, the extension throws an error:
Runtime Error 'NoneType' object has no attribute 'find_generate_macro_by_name'
{
"code": -1,
"message": "Runtime Error\n Runtime Error\n 'NoneType' object has no attribute 'find_generate_macro_by_name'",
"data": "\"Error: Traceback (most recent call last):\\n File \\\"c:\\\\Users\\\\me\\\\.vscode\\\\extensions\\\\innoverio.vscode-dbt-power-user-0.10.1\\\\dist\\\\dbt_integration.py\\\", line 447, in compile_sql\\n node = self.compile_node(self.get_server_node(raw_sql, temp_node_id))\\n File \\\"c:\\\\Users\\\\me\\\\.vscode\\\\extensions\\\\innoverio.vscode-dbt-power-user-0.10.1\\\\dist\\\\dbt_integration.py\\\", line 373, in get_server_node\\n sql_node = self.sql_parser.parse_remote(sql, node_name)\\n File \\\"c:\\\\Users\\\\me\\\\.vscode\\\\extensions\\\\innoverio.vscode-dbt-power-user-0.10.1\\\\dist\\\\dbt_integration.py\\\", line 266, in sql_parser\\n self._sql_parser = SqlBlockParser(self.config, self.dbt, self.config)\\n File \\\"c:\\\\Users\\\\me\\\\Projects\\\\de-dbt\\\\.venv\\\\lib\\\\site-packages\\\\dbt\\\\parser\\\\base.py\\\", line 105, in __init__\\n self._update_node_database = RelationUpdate(\\n File \\\"c:\\\\Users\\\\me\\\\Projects\\\\de-dbt\\\\.venv\\\\lib\\\\site-packages\\\\dbt\\\\parser\\\\base.py\\\", line 74, in __init__\\n macro = manifest.find_generate_macro_by_name(\\nAttributeError: 'NoneType' object has no attribute 'find_generate_macro_by_name'\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n File \\\"c:\\\\Users\\\\me\\\\.vscode\\\\extensions\\\\innoverio.vscode-dbt-power-user-0.10.1\\\\dist\\\\dbt_integration.py\\\", line 409, in execute_sql\\n compilation_result = self.compile_sql(raw_sql)\\n File \\\"c:\\\\Users\\\\me\\\\.vscode\\\\extensions\\\\innoverio.vscode-dbt-power-user-0.10.1\\\\dist\\\\dbt_integration.py\\\", line 451, in compile_sql\\n raise RuntimeException(str(e))\\ndbt.exceptions.RuntimeException: Runtime Error\\n 'NoneType' object has no attribute 'find_generate_macro_by_name'\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n File \\\"c:\\\\Users\\\\me\\\\.vscode\\\\extensions\\\\innoverio.vscode-dbt-power-user-0.10.1\\\\dist\\\\node_python_bridge.py\\\", line 104, in <module>\\n value = eval(_compile(data['code'], '<input>', 'eval'), _locals)\\n File \\\"<input>\\\", line 1, in <module>\\n File \\\"c:\\\\Users\\\\me\\\\.vscode\\\\extensions\\\\innoverio.vscode-dbt-power-user-0.10.1\\\\dist\\\\dbt_integration.py\\\", line 418, in execute_sql\\n raise RuntimeException(str(e))\\ndbt.exceptions.RuntimeException: Runtime Error\\n Runtime Error\\n 'NoneType' object has no attribute 'find_generate_macro_by_name'\\n\\n\\tat ChildProcess.onMessage (c:\\\\Users\\\\me\\\\.vscode\\\\extensions\\\\innoverio.vscode-dbt-power-user-0.10.1\\\\dist\\\\extension.js:4796:184)\\n\\tat Object.onceWrapper (node:events:646:26)\\n\\tat ChildProcess.emit (node:events:526:28)\\n\\tat emit (node:internal/child_process:938:14)\\n\\tat process.processTicksAndRejections (node:internal/process/task_queues:84:21)\""
}
Steps To Reproduce
Exact steps to reproduce are not clear. It maybe environment specific
Log output/Screenshots
No response
Operating System
Windows 11 Pro. Version 10.0.22000 Build 22000
dbt version
1.3.1
dbt Adapter
dbt-snowflake
dbt Power User version
0.10.1
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Issue Analytics
- State:
- Created 10 months ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Why do I get AttributeError: 'NoneType' object has no attribute ...
NoneType means that instead of an instance of whatever Class or Object you think you're working with, you've actually got None .
Read more >What does Runtime error : 'NoneType' object has no attribute ...
As you are using a for loop to iterate through the rows there is no need to use row=rows.next() see online help for...
Read more >Runtime Error - 'NoneType' object has no attribute 'Close'
I'm receiving this log error: Runtime Error: In Scheduled Event 'SPY: EveryDay: 9', AttributeError : 'NoneType' object has no attribute 'Close' at Rebalance...
Read more >Error: "AttributeError: 'NoneType' object has no a... - Alteryx ...
Error : "AttributeError: 'NoneType' object has no attribute 'suppress'" Environment Details When using Selenium to do web scraping in Python.
Read more >'NoneType' object has no attribute 'Branches' - McNeel Forum
Please help me fix this problem with my Grasshopper python script editor. I got this error (Error: Runtime error (MissingMemberException): 'NoneType' object ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @sdepablos 🙌 that solved it!
That’s an actionable problem that can be detected by the extension. Thanks @sdepablos for helping understand this.
I’ll keep the issue open until I add detection for this issue and show a warning.