Skip to content

Commit

Permalink
Integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neelasha23 committed Jul 4, 2023
1 parent 72454ee commit fec122d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/sql/error_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def detail(original_error, query=None):
parse_msg = parse_sqlglot_error(e, q)
return_msg = return_msg + parse_msg if parse_msg else return_msg

return return_msg + "\n" + ORIGINAL_ERROR + original_error + "\n"
cte_msg = "If using CTEs, you may pass the --with argument explicitly."
return (
return_msg + "\n" + ORIGINAL_ERROR + original_error + "\n" + cte_msg + "\n"
)

if "fe_sendauth: no password supplied" in original_error:
return (
Expand Down
4 changes: 3 additions & 1 deletion src/tests/integration/test_generic_db_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,4 +667,6 @@ def test_sql_query_snippet_error(ip_with_dynamic_db, request):
%%sql
SELECT * FROM second_cte"""
)
assert out.error_in_exec is None
assert "If using CTEs, you may pass the --with argument explicitly." in str(
out.error_in_exec
)

0 comments on commit fec122d

Please sign in to comment.