Skip to content

Commit

Permalink
fix: Deque muteted during iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Jun 29, 2023
1 parent 66f59e5 commit 5df2387
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions superset/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,23 +850,23 @@ def ping_connection(connection: Connection, branch: bool) -> None:
# restore 'close with result'
connection.should_close_with_result = save_should_close_with_result

if some_engine.dialect.name == "sqlite":

@event.listens_for(some_engine, "connect")
def set_sqlite_pragma( # pylint: disable=unused-argument
connection: sqlite3.Connection,
*args: Any,
) -> None:
r"""
Enable foreign key support for SQLite.
:param connection: The SQLite connection
:param \*args: Additional positional arguments
:see: https://docs.sqlalchemy.org/en/latest/dialects/sqlite.html
"""

with closing(connection.cursor()) as cursor:
cursor.execute("PRAGMA foreign_keys=ON")
if some_engine.dialect.name == "sqlite":

@event.listens_for(some_engine, "connect")
def set_sqlite_pragma( # pylint: disable=unused-argument
connection: sqlite3.Connection,
*args: Any,
) -> None:
r"""
Enable foreign key support for SQLite.
:param connection: The SQLite connection
:param \*args: Additional positional arguments
:see: https://docs.sqlalchemy.org/en/latest/dialects/sqlite.html
"""

with closing(connection.cursor()) as cursor:
cursor.execute("PRAGMA foreign_keys=ON")


def send_email_smtp( # pylint: disable=invalid-name,too-many-arguments,too-many-locals
Expand Down

0 comments on commit 5df2387

Please sign in to comment.