summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/create.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-08-21 14:44:04 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-08-25 20:10:16 -0400
commit3668b3a30c4b9a9f4af13457f43bfc34c28cf448 (patch)
tree6be6b991de7f3eb06181fd045b003e1b6d7e250e /lib/sqlalchemy/engine/create.py
parent9b6b867fe59d74c23edca782dcbba9af99b62817 (diff)
downloadsqlalchemy-3668b3a30c4b9a9f4af13457f43bfc34c28cf448.tar.gz
make URL immutable
it's not really correct that URL is mutable and doesn't do any argument checking. propose replacing it with an immutable named tuple with rich copy-and-mutate methods. At the moment this makes a hard change to the CreateEnginePlugin docs that previously recommended url.query.pop(). I can't find any plugins on github other than my own that are using this feature, so see if we can just make a hard change on this one. Fixes: #5526 Change-Id: I28a0a471d80792fa8c28f4fa573d6352966a4a79
Diffstat (limited to 'lib/sqlalchemy/engine/create.py')
-rw-r--r--lib/sqlalchemy/engine/create.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/sqlalchemy/engine/create.py b/lib/sqlalchemy/engine/create.py
index 66173d9b0..e31f3a12d 100644
--- a/lib/sqlalchemy/engine/create.py
+++ b/lib/sqlalchemy/engine/create.py
@@ -486,10 +486,7 @@ def create_engine(url, **kwargs):
# create url.URL object
u = _url.make_url(url)
- plugins = u._instantiate_plugins(kwargs)
-
- u.query.pop("plugin", None)
- kwargs.pop("plugins", None)
+ u, plugins, kwargs = u._instantiate_plugins(kwargs)
entrypoint = u._get_entrypoint()
dialect_cls = entrypoint.get_dialect_cls(u)