Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC methods should exclude Jinja comments from compiled SQL #2621

Closed
jtcohen6 opened this issue Jul 9, 2020 · 1 comment
Closed

RPC methods should exclude Jinja comments from compiled SQL #2621

jtcohen6 opened this issue Jul 9, 2020 · 1 comment
Labels
bug Something isn't working rpc Issues related to dbt's RPC server

Comments

@jtcohen6
Copy link
Contributor

jtcohen6 commented Jul 9, 2020

Describe the bug

The compile_sql and run_sql methods of dbt rpc currently include Jinja comments {# #} in their compiled SQL.

Steps To Reproduce

  1. Run an RPC server per docs

  2. Send a request (method compile_sql or run_sql) where the SQL contains a Jinja comment

{
    "jsonrpc": "2.0",
    "method": "compile_sql",
    "id": "2db9a2fe-9a39-41ef-828c-25e04dd6b07d",
    "params": {
        "timeout": 60,
        "sql": "c2VsZWN0IHsjIDEgKyAxICN9IGFzIGlkCg==",
        "name": "my_first_query"
    }
}
  1. Poll for result
...
"raw_sql": "select {# 1 + 1 #} as id\n",
"compiled_sql": "select {# 1 + 1 #} as id\n",
...

Expected behavior

"raw_sql": "select {# 1 + 1 #} as id\n",
"compiled_sql": "select  as id\n",

The output of dbt --version:

$ dbt --version
installed version: 0.17.1-rc4
   latest version: 0.17.0

Your version of dbt is ahead of the latest release!

Plugins:
  - bigquery: 0.17.1rc4
  - snowflake: 0.17.1rc4
  - redshift: 0.17.1rc4
  - postgres: 0.17.1rc4
@jtcohen6 jtcohen6 added bug Something isn't working rpc Issues related to dbt's RPC server labels Jul 9, 2020
@beckjake
Copy link
Contributor

I missed this until just now, but this is in fact the same as #2707 - closing as it's fixed by #2718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rpc Issues related to dbt's RPC server
Projects
None yet
Development

No branches or pull requests

2 participants