Open mroy-seedbox opened 6 days ago
I think it should be doable for SQLFluff to expose these python modules as well.
But in the meantime, a workaround is to wrap the methods that we need in a macro, and them configure the macro in [sqlfluff:templater:jinja:macros]
.
Search before asking
Description
DBT exposes a modules variable which can be used to access some python modules:
datetime
,pytz
,re
, anditertools
.Undefined jinja template variable: 'modules'
.modules = {"datetime": {"date": {}}}
, we get this error when we try to usemodules.datetime.something()
:Unrecoverable failure in Jinja templating: 'dict' object is not callable.
Is there any way to define a template variable as a callable?
Dialect
Any.
Are you willing to work on and submit a PR to address the issue?
Although I do not have the time at the moment.
Code of Conduct