AltimateAI / vscode-dbt-power-user

This extension makes vscode seamlessly work with dbt™: Auto-complete, preview, column lineage, AI docs generation, health checks, cost estimation etc
https://www.altimate.ai
MIT License
471 stars 94 forks source link

An error occured while trying to compile your query: Runtime Error got an update_sql operation call with an unrecognized sql operation: sql <REDACTED> #453

Open nandubatchu opened 1 year ago

nandubatchu commented 1 year ago

Expected behavior

Should be able to view compiled SQL and be able to run and get query results either entire model or of selection

Actual behavior

Not able to either view compiled sql nor able to get query results

Steps To Reproduce

Initialise a dbt-glue repo and setup a very basic model

Log output/Screenshots

{ "code": -1, "message": "Database Error\n Glue cursor returned error for statement None for code SqlWrapper2.execute('''/ {\"app\": \"dbt\", \"dbt_version\": \"1.3.2\", \"profile_name\": \"\", \"target_name\": \"dev\", \"connection_name\": \"master\"} /\n '''), ParseException: \n mismatched input '' expecting {'(', 'ADD', 'ALTER', 'ANALYZE', 'CACHE', 'CLEAR', 'COMMENT', 'COMMIT', 'CREATE', 'DELETE', 'DESC', 'DESCRIBE', 'DFS', 'DROP', 'EXPLAIN', 'EXPORT', 'FROM', 'GRANT', 'IMPORT', 'INSERT', 'LIST', 'LOAD', 'LOCK', 'MAP', 'MERGE', 'MSCK', 'REDUCE', 'REFRESH', 'REPLACE', 'RESET', 'REVOKE', 'ROLLBACK', 'SELECT', 'SET', 'SHOW', 'START', 'TABLE', 'TRUNCATE', 'UNCACHE', 'UNLOCK', 'UPDATE', 'USE', 'VALUES', 'WITH'}(line 2, pos 0)\n \n == SQL ==\n / {\"app\": \"dbt\", \"dbt_version\": \"1.3.2\", \"profile_name\": \"\", \"target_name\": \"dev\", \"connection_name\": \"master\"} /\n ^^^\n ", "data": "\"Error: Traceback (most recent call last):\n File \\"/home/vscode/.vscode-server/extensions/innoverio.vscode-dbt-power-user-0.13.0/dist/node_python_bridge.py\\", line 104, in \n value = eval(_compile(data['code'], '', 'eval'), _locals)\n File \\"\\", line 1, in \n File \\"/home/vscode/.vscode-server/extensions/innoverio.vscode-dbt-power-user-0.13.0/dist/dbt_integration.py\\", line 412, in execute_sql\n self.adapter_execute(compiled_sql, fetch=True),\n File \\"/home/vscode/.vscode-server/extensions/innoverio.vscode-dbt-power-user-0.13.0/dist/dbt_integration.py\\", line 391, in adapter_execute\n return self.adapter.execute(sql, auto_begin, fetch)\n File \\"/home/vscode/.local/lib/python3.8/site-packages/dbt/adapters/base/impl.py\\", line 278, in execute\n return self.connections.execute(sql=sql, auto_begin=autobegin, fetch=fetch)\n File \\"/home/vscode/.local/lib/python3.8/site-packages/dbt/adapters/sql/connections.py\\", line 123, in execute\n , cursor = self.add_query(sql, auto_begin)\n File \\"/home/vscode/.local/lib/python3.8/site-packages/dbt/adapters/sql/connections.py\\", line 70, in add_query\n cursor.execute(sql, bindings)\n File \\"/home/vscode/.local/lib/python3.8/site-packages/dbt/adapters/glue/gluedbapi/cursor.py\\", line 134, in execute\n raise dbterrors.DatabaseException(msg=error_message)\ndbt.exceptions.DatabaseException: Database Error\n Glue cursor returned error for statement None for code SqlWrapper2.execute('''/ {\\"app\\": \\"dbt\\", \\"dbt_version\\": \\"1.3.2\\", \\"profile_name\\": \\"\\", \\"target_name\\": \\"dev\\", \\"connection_name\\": \\"master\\"} /\n '''), ParseException: \n mismatched input '' expecting {'(', 'ADD', 'ALTER', 'ANALYZE', 'CACHE', 'CLEAR', 'COMMENT', 'COMMIT', 'CREATE', 'DELETE', 'DESC', 'DESCRIBE', 'DFS', 'DROP', 'EXPLAIN', 'EXPORT', 'FROM', 'GRANT', 'IMPORT', 'INSERT', 'LIST', 'LOAD', 'LOCK', 'MAP', 'MERGE', 'MSCK', 'REDUCE', 'REFRESH', 'REPLACE', 'RESET', 'REVOKE', 'ROLLBACK', 'SELECT', 'SET', 'SHOW', 'START', 'TABLE', 'TRUNCATE', 'UNCACHE', 'UNLOCK', 'UPDATE', 'USE', 'VALUES', 'WITH'}(line 2, pos 0)\n \n == SQL ==\n / {\\"app\\": \\"dbt\\", \\"dbt_version\\": \\"1.3.2\\", \\"profile_name\\": \\"\\", \\"target_name\\": \\"dev\\", \\"connection_name\\": \\"master\\"} */\n ^^^\n \n\n\tat ChildProcess.onMessage (/home/vscode/.vscode-server/extensions/innoverio.vscode-dbt-power-user-0.13.0/dist/extension.js:5563:184)\n\tat Object.onceWrapper (node:events:628:26)\n\tat ChildProcess.emit (node:events:513:28)\n\tat ChildProcess.emit (node:domain:489:12)\n\tat emit (node:internal/child_process:939:14)\n\tat processTicksAndRejections (node:internal/process/task_queues:84:21)\"" }

Operating System

Debian GNU/Linux 11 (bullseye)

dbt version

1.3.2

dbt Adapter

dbt-glue

dbt Power User version

v0.13.0

Are you willing to submit PR?

anandgupta42 commented 1 year ago

@nandubatchu We have pushed a bunch of error fixes lately. Please upgrade to the latest version and let us know if this is still an issue.

kyleburke-meq commented 3 months ago

I am also getting this error. Was this ever resolved?