Skip to content

Commit 59d585e

Browse files
committed
chore: fix type: set[str] instead of Template
1 parent d68ac34 commit 59d585e

File tree

1 file changed

+3
-3
lines changed
  • airbyte_cdk/sources/declarative/interpolation

1 file changed

+3
-3
lines changed

airbyte_cdk/sources/declarative/interpolation/jinja.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _literal_eval(self, result: Optional[str], valid_types: Optional[Tuple[Type[
120120
def _eval(self, s: Optional[str], context: Mapping[str, Any]) -> Optional[str]:
121121
try:
122122
undeclared = self._find_undeclared_variables(s)
123-
undeclared_not_in_context = {var for var in undeclared if var not in context} # type: ignore [attr-defined] # `Template` class not iterable
123+
undeclared_not_in_context = {var for var in undeclared if var not in context}
124124
if undeclared_not_in_context:
125125
raise ValueError(
126126
f"Jinja macro has undeclared variables: {undeclared_not_in_context}. Context: {context}"
@@ -132,12 +132,12 @@ def _eval(self, s: Optional[str], context: Mapping[str, Any]) -> Optional[str]:
132132
return s
133133

134134
@cache
135-
def _find_undeclared_variables(self, s: Optional[str]) -> Template:
135+
def _find_undeclared_variables(self, s: Optional[str]) -> set[str]:
136136
"""
137137
Find undeclared variables and cache them
138138
"""
139139
ast = self._environment.parse(s) # type: ignore # parse is able to handle None
140-
return meta.find_undeclared_variables(ast) # type: ignore [return-value] # Expected `Template` but got `set[str]`
140+
return meta.find_undeclared_variables(ast)
141141

142142
@cache
143143
def _compile(self, s: Optional[str]) -> Template:

0 commit comments

Comments
 (0)