Skip to content

Jinja templating from comments shows an error in SQL Lab #32044

Open
@geido

Description

@geido

Bug description

  • Go to SQL Lab
  • Use the following query:
with ws1 as ( 
 select 1 as one
)
select * from ws1 --{{ ref('value_date_delinquent_dates')|length }}
  • Run query

Expected results

The query should run without errors

Actual results

This error is returned:

Parameter error: Failed to execute query '5' - 'with ws1 as ( select 1 as one ) select * from ws1 --{{ ref('value_date_delinquent_dates')|length }} ': The query contains one or more malformed template parameters. Please check your query and confirm that all template parameters are surround by double braces, for example, "{{ ds }}". Then, try running your query again.

Screenshots/recordings

Image

Superset version

master / latest-dev

Python version

3.9

Node version

18 or greater

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    global:jinjaRelated to Jinja templatingpreset:bountyIssues that have been selected by Preset and have a bounty attached.preset:bounty:bugBugs that have been selected by Preset and have a bounty attached.sqllabNamespace | Anything related to the SQL Lab

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions