Macros execute commented out SQL, in my case creating a circular reference
See original GitHub issueDescribe the bug
A clear and concise description of what the bug is. What command did you run? What happened?
Steps To Reproduce
Create a macro with the following code, and try to build any model
-- To use, call {{ my_macro() }}
{% macro my_macro() %}
'order by 1'
{% endmacro %}
Expected behavior
The first line to be ignored because it’s an SQL file, so --
should be ignored
Screenshots and log output
maximum recursion depth exceeded while calling a Python object```
### System information
**Which database are you using dbt with?**
Redshift
**The output of `dbt --version`:**
installed version: 0.13.0 latest version: 0.14.2
Your version of dbt is out of date! You can find instructions for upgrading here: https://docs.getdbt.com/docs/installation
**The operating system you're using:**
Mac OSX 10.14.6
**The output of `python --version`:**
Python 3.6.8
### Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Macros execute commented out SQL, in my case creating a ...
Steps To Reproduce Create a macro with the following code, ... Macros execute commented out SQL, in my case creating a circular reference...
Read more >Circular reference in Excel: how to find, enable, use, or remove
For circular formulas to work, you must enable iterative calculations in your Excel workbook. In Excel 2010 and higher, click File > Options,...
Read more >16.20 - Circular References - Teradata Database
References can be defined as circular in that Table A can reference Table B, which can reference Table A. In this case, at...
Read more >Circular Reference Warning when I open up Workbook
My Workbook includes Macros and seems to run fine, is it possible the Circular Reference could be within the VBA code but still...
Read more >Thread: Circular reference in a formula - VBA Express
I want to run a macro to check whether the formula in the each cell has a circular reference. When we check for...
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 Free
Top 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
Thanks @drewbanin 😃
ah! Sure - that makes sense. Check out this issue – I think a good course of action would be to let users configure the file extensions for these types of resources. Strictly speaking, dbt models aren’t really SQL files either – it’s definitely reasonable to want to name them
.jinja.sql
, or similar!