You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this one line of jinja2 that contains no html. It is a valid template that jinja2 is able to parse. I can additionally write some additional parts of the template to actually use the assigned value here and am able to render it
When inferring this I receive the following stack trace:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\jinja2schema\visitors\expr.py", line 116, in meet
merge(self.predicted_struct, actual_struct)
File "C:\Python34\lib\site-packages\jinja2schema\mergers.py", line 66, in merge
raise MergeException(fst, snd)
jinja2schema.exceptions.MergeException: unnamed variable (used as scalar on lines 1) conflicts with unnamed variable (used as list on lines: )
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test.py", line 8, in <module>
print(jinja2schema.infer(data))
File "C:\Python34\lib\site-packages\jinja2schema\core.py", line 66, in infer
return infer_from_ast(parse(template), config=config, ignore_constants=True)
File "C:\Python34\lib\site-packages\jinja2schema\core.py", line 49, in infer_from_ast
rv = visit(ast, {}, config)
File "C:\Python34\lib\site-packages\jinja2schema\visitors\util.py", line 20, in visit
structure = visit_many(node.body, macroses, config)
File "C:\Python34\lib\site-packages\jinja2schema\visitors\util.py", line 37, in visit_many
structure = visit(node, macroses, config, predicted_struct_cls, return_struct_cls)
File "C:\Python34\lib\site-packages\jinja2schema\visitors\util.py", line 14, in visit
structure = visit_stmt(node, macroses, config)
File "C:\Python34\lib\site-packages\jinja2schema\visitors\stmt.py", line 54, in visit_stmt
return visitor(ast, macroses, config)
File "C:\Python34\lib\site-packages\jinja2schema\visitors\stmt.py", line 134, in visit_assign
predicted_struct=Unknown.from_ast(var_ast, order_nr=config.ORDER_OBJECT.get_next())), macroses, config)
File "C:\Python34\lib\site-packages\jinja2schema\visitors\expr.py", line 156, in visit_expr
return visitor(ast, ctx, macroses, config=config)
File "C:\Python34\lib\site-packages\jinja2schema\visitors\expr.py", line 534, in visit_filter
), macroses, config=config)
File "C:\Python34\lib\site-packages\jinja2schema\visitors\expr.py", line 156, in visit_expr
return visitor(ast, ctx, macroses, config=config)
File "C:\Python34\lib\site-packages\jinja2schema\visitors\expr.py", line 509, in visit_filter
ctx.meet(List(Unknown()), ast)
File "C:\Python34\lib\site-packages\jinja2schema\visitors\expr.py", line 118, in meet
raise UnexpectedExpression(self.predicted_struct, actual_ast, actual_struct)
jinja2schema.exceptions.UnexpectedExpression: conflict on the line 1
got: AST node jinja2.nodes.Filter of structure [<unknown>]
expected structure: <scalar>
I have this one line of jinja2 that contains no html. It is a valid template that jinja2 is able to parse. I can additionally write some additional parts of the template to actually use the assigned value here and am able to render it
When inferring this I receive the following stack trace:
Here is the AST jinja2 gives from parsing:
The text was updated successfully, but these errors were encountered: