Skip to content

Commit 4be29b6

Browse files
authored
fix(jinja): make _compile / _find_undeclared_variables static (#594)
1 parent a1b575f commit 4be29b6

File tree

1 file changed

+4
-2
lines changed
  • airbyte_cdk/sources/declarative/interpolation

1 file changed

+4
-2
lines changed

airbyte_cdk/sources/declarative/interpolation/jinja.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,18 @@ def _eval(self, s: Optional[str], context: Mapping[str, Any]) -> Optional[str]:
147147
# It can be returned as is
148148
return s
149149

150+
@staticmethod
150151
@cache
151-
def _find_undeclared_variables(self, s: Optional[str]) -> Set[str]:
152+
def _find_undeclared_variables(s: Optional[str]) -> Set[str]:
152153
"""
153154
Find undeclared variables and cache them
154155
"""
155156
ast = _ENVIRONMENT.parse(s) # type: ignore # parse is able to handle None
156157
return meta.find_undeclared_variables(ast)
157158

159+
@staticmethod
158160
@cache
159-
def _compile(self, s: str) -> Template:
161+
def _compile(s: str) -> Template:
160162
"""
161163
We must cache the Jinja Template ourselves because we're using `from_string` instead of a template loader
162164
"""

0 commit comments

Comments
 (0)