Skip to content

Commit ca88d1e

Browse files
committed
chore: Clean up parameter style handling for DuckDB dialect
1 parent d75c32f commit ca88d1e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

deepnote_toolkit/sql/sql_execution.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,11 @@ class ExecuteSqlError(Exception):
156156
url_obj = make_url(sql_alchemy_dict["url"])
157157
# Mapping of SQLAlchemy dialect names to their required param_style
158158
dialect_param_styles = {
159-
"trino": "qmark", # Trino requires ? placeholders with list/tuple params
159+
"trino": "qmark", # Trino only supports qmark style
160+
"deepnote+duckdb": "qmark", # DuckDB officially recommends qmark style (doesn't support pyformat)
160161
}
161162
param_style = dialect_param_styles.get(url_obj.drivername)
162163

163-
if requires_duckdb and param_style is None:
164-
# DuckDB uses the DB-API qmark style (`?` placeholders)
165-
param_style = "qmark"
166-
167164
skip_template_render = re.search(
168165
"^snowflake.*host=.*.proxy.cloud.getdbt.com", sql_alchemy_dict["url"]
169166
)

0 commit comments

Comments
 (0)