mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
fix(uploads): respect db engine spec's supports_multivalues_insert value for file uploads & enable multi-insert for MSSQL (#30222)
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
This commit is contained in:
@@ -347,6 +347,7 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods
|
||||
# Does database support join-free timeslot grouping
|
||||
time_groupby_inline = False
|
||||
limit_method = LimitMethod.FORCE_LIMIT
|
||||
supports_multivalues_insert = False
|
||||
allows_joins = True
|
||||
allows_subqueries = True
|
||||
allows_alias_in_select = True
|
||||
@@ -1283,9 +1284,11 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods
|
||||
catalog=table.catalog,
|
||||
schema=table.schema,
|
||||
) as engine:
|
||||
if engine.dialect.supports_multivalues_insert:
|
||||
if (
|
||||
engine.dialect.supports_multivalues_insert
|
||||
or cls.supports_multivalues_insert
|
||||
):
|
||||
to_sql_kwargs["method"] = "multi"
|
||||
|
||||
df.to_sql(con=engine, **to_sql_kwargs)
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -53,6 +53,7 @@ class MssqlEngineSpec(BaseEngineSpec):
|
||||
max_column_name_length = 128
|
||||
allows_cte_in_subquery = False
|
||||
allow_limit_clause = False
|
||||
supports_multivalues_insert = True
|
||||
|
||||
_time_grain_expressions = {
|
||||
None: "{col}",
|
||||
|
||||
Reference in New Issue
Block a user