Filter out the init_command key

TypeError: 'init_command' is an invalid keyword argument for Connection()
This commit is contained in:
tcely authored and GitHub committed 2024-12-11 16:04:09 -05:00
1 parent 467ec947ff
commit ebf1ed3ef4
1 file changed
+4 -2
+4 -2
View File
@@ -27,7 +27,9 @@ class DatabaseWrapper(base.DatabaseWrapper):
def get_new_connection(self, conn_params):
conn_params["isolation_level"] = conn_params.pop("transaction_mode", "DEFERRED")
super().get_new_connection(conn_params)
filtered_params = conn_params.copy()
filtered_params["isolation_level"] = filtered_params.pop("transaction_mode", "DEFERRED")
_ = filtered_params.pop("init_command", None)
super().get_new_connection(filtered_params)