File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,10 @@ class ExecuteSqlError(Exception):
160160 }
161161 param_style = dialect_param_styles .get (url_obj .drivername )
162162
163+ if requires_duckdb and param_style is None :
164+ # DuckDB uses the DB-API qmark style (`?` placeholders)
165+ param_style = "qmark"
166+
163167 skip_template_render = re .search (
164168 "^snowflake.*host=.*.proxy.cloud.getdbt.com" , sql_alchemy_dict ["url" ]
165169 )
@@ -294,10 +298,7 @@ def _execute_sql_with_caching(
294298):
295299 # duckdb SQL is not cached, so we can skip the logic below for duckdb
296300 if requires_duckdb :
297- # duckdb requires % to be unescaped, but other dialects require it to be escaped as %%
298- # https://docs.sqlalchemy.org/en/14/faq/sqlexpressions.html#why-are-percent-signs-being-doubled-up-when-stringifying-sql-statements
299- query_unescaped = query % () if query else query
300- dataframe = execute_duckdb_sql (query_unescaped , bind_params )
301+ dataframe = execute_duckdb_sql (query , bind_params )
301302 # for Chained SQL we return the dataframe with the SQL source attached as DeepnoteQueryPreview object
302303 if return_variable_type == "query_preview" :
303304 return _convert_dataframe_to_query_preview (dataframe , query_preview_source )
You can’t perform that action at this time.
0 commit comments