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.

load_macros_from_path should allow exceptions

See original GitHub issue

Context

We are working with dbt in BigQuery and, as part of that, have created a new materialization strategy to handle some use cases that weren’t properly addressed by built-in dbt options. This means that we have a macro in our macros folder containing this line:

{% materialization incremental, adapter='bigquery' -%}

Issue

The materialization tag is not recognised, giving this error:

jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'materialization'

Clearly, one solution would be to add a jinja extension that covers this tag, which I definitely would appreciate, but since there’s always a risk of this scenario cropping up it seems there should be an option to exclude certain paths from the load_macros_from_path statement in [sqlfluff:templater:jinja].

Alternatively, being able to specify multiple paths would be nice, since then we could add all the subfolders in our macros directory except for the one causing the error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pwildenhaincommented, Oct 3, 2020

I’m considering changing how we support the compiling of templates and actually getting dbt to do the rendering of queries, which would solve a load of these issues.

I’m 💯 in agreement with this. If people are using dbt anyway with this project, then I think we should just use dbt to compile the queries, and eliminate the need to double document macros

Could this be added as a config option? Should this be a separate plugin (like sqlfluff-dbt)?

0reactions
noahbruegmanncommented, Jan 26, 2021

I can confirm that we’ve been testing this on a few different projects now and it seems to be working well. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Macros from the internet will be blocked by default in Office
This SECURITY RISK banner doesn't have the option to Enable content. But users will be able to go to the Properties dialog for...
Read more >
How To Enable Macros In Excel: Step-By-Step Guide For 3 ...
Learn how to enable macros in Excel 2013 or 2016. Step-by-step guide that shows you how to easily deal with 3 common macro...
Read more >
Unable to Throw Exception during Excel Macro execution - Help
I'm currently trying to execute a printing macro within an excel scope, ... If path is a problem then it should throw exception...
Read more >
Restricting or blocking Office 2016/2019 macros with Group ...
Here it makes sense to allow only digitally signed macros. But you have to do this per application. The respective option is VBA...
Read more >
Configuration — SQLFluff 1.4.5 documentation
That means you'll end up with a final config which will be a patchwork of all the values from the config files loaded...
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