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
What:
SQL class gives an error when query that is starting with with (or select) doesn't return data - for example when after with there is insert into statement.
Error: Error during execution of task: ProgrammingError('No results. Previous SQL was not a query.')
Code causing error:
base.py
SQL class
if query_sanitized.startswith("SELECT") or query_sanitized.startswith("WITH"):
result = cursor.fetchall()
else:
result = True
Example:
with
base as (
select
name
,age
from sandbox.my_table
)
insert into sandbox.new_table
select * from base
;
Possible solution:
try except block?
The text was updated successfully, but these errors were encountered:
Isn't this because you were running multiple queries, including DML? run is only for running one query at a time. So only a WITH, only an INSERT, or only a SELECT.
You're right but this class doesn't handle insert + wouldn't it be better if option above doesn't cause an error? Maybe it's not a default query that we're running but there are also cases when this is needed
What:
SQL class gives an error when query that is starting with
with
(orselect
) doesn't return data - for example when after with there is insert into statement.Error:
Error during execution of task: ProgrammingError('No results. Previous SQL was not a query.')
Code causing error:
base.py
SQL class
Example:
Possible solution:
try except block?
The text was updated successfully, but these errors were encountered: