betodealmeida commented on code in PR #21943:
URL: https://github.com/apache/superset/pull/21943#discussion_r1022015430
##########
superset/db_engine_specs/base.py:
##########
@@ -894,17 +903,17 @@ def df_to_sql(
:param to_sql_kwargs: The kwargs to be passed to
pandas.DataFrame.to_sql` method
"""
- engine = cls.get_engine(database)
to_sql_kwargs["name"] = table.table
if table.schema:
# Only add schema when it is preset and non empty.
to_sql_kwargs["schema"] = table.schema
- if engine.dialect.supports_multivalues_insert:
- to_sql_kwargs["method"] = "multi"
+ with cls.get_engine(database) as engine:
+ if engine.dialect.supports_multivalues_insert:
+ to_sql_kwargs["method"] = "multi"
Review Comment:
Ah, good point, I missed that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]