question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Macros execute commented out SQL, in my case creating a circular reference

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jonniepellercommented, Sep 18, 2019

Thanks @drewbanin 😃

0reactions
drewbanincommented, Sep 18, 2019

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found