-
Notifications
You must be signed in to change notification settings - Fork 90
Feat/plugins - deprecate otumate and old plugins #1253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ad22ece
24bacc8
e7c0528
dbe6c2a
3af49a1
64e0ce9
c3a4d68
9342dd7
c2895c7
220eaf8
b3009db
d083489
8631da4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,6 @@ | |
| from .blob import pack, unpack | ||
| from .dependencies import Dependencies | ||
| from .hash import uuid_from_buffer | ||
| from .plugin import connection_plugins | ||
| from .settings import config | ||
| from .version import __version__ | ||
|
|
||
|
|
@@ -27,33 +26,6 @@ | |
| cache_key = "query_cache" # the key to lookup the query_cache folder in dj.config | ||
|
|
||
|
|
||
| def get_host_hook(host_input): | ||
| if "://" in host_input: | ||
| plugin_name = host_input.split("://")[0] | ||
| try: | ||
| return connection_plugins[plugin_name]["object"].load().get_host(host_input) | ||
| except KeyError: | ||
| raise errors.DataJointError( | ||
| "Connection plugin '{}' not found.".format(plugin_name) | ||
| ) | ||
| else: | ||
| return host_input | ||
|
|
||
|
|
||
| def connect_host_hook(connection_obj): | ||
| if "://" in connection_obj.conn_info["host_input"]: | ||
| plugin_name = connection_obj.conn_info["host_input"].split("://")[0] | ||
| try: | ||
| connection_plugins[plugin_name]["object"].load().connect_host( | ||
| connection_obj | ||
| ) | ||
| except KeyError: | ||
| raise errors.DataJointError( | ||
| "Connection plugin '{}' not found.".format(plugin_name) | ||
| ) | ||
| else: | ||
| connection_obj.connect() | ||
|
|
||
|
|
||
| def translate_query_error(client_error, query): | ||
| """ | ||
|
|
@@ -177,7 +149,6 @@ class Connection: | |
| """ | ||
|
|
||
| def __init__(self, host, user, password, port=None, init_fun=None, use_tls=None): | ||
|
||
| host_input, host = (host, get_host_hook(host)) | ||
| if ":" in host: | ||
| # the port in the hostname overrides the port argument | ||
| host, port = host.split(":") | ||
|
|
@@ -190,11 +161,9 @@ def __init__(self, host, user, password, port=None, init_fun=None, use_tls=None) | |
| use_tls if isinstance(use_tls, dict) else {"ssl": {}} | ||
| ) | ||
| self.conn_info["ssl_input"] = use_tls | ||
| self.conn_info["host_input"] = host_input | ||
| self.init_fun = init_fun | ||
| self._conn = None | ||
| self._query_cache = None | ||
| connect_host_hook(self) | ||
| if self.is_connected: | ||
| logger.info( | ||
| "DataJoint {version} connected to {user}@{host}:{port}".format( | ||
|
|
@@ -232,7 +201,7 @@ def connect(self): | |
| **{ | ||
| k: v | ||
| for k, v in self.conn_info.items() | ||
| if k not in ["ssl_input", "host_input"] | ||
| if k not in ["ssl_input"] | ||
| }, | ||
| ) | ||
| except client.err.InternalError: | ||
|
|
@@ -245,7 +214,7 @@ def connect(self): | |
| k: v | ||
| for k, v in self.conn_info.items() | ||
| if not ( | ||
| k in ["ssl_input", "host_input"] | ||
| k in ["ssl_input"] | ||
| or k == "ssl" | ||
| and self.conn_info["ssl_input"] is None | ||
| ) | ||
|
|
@@ -352,7 +321,7 @@ def query( | |
| if not reconnect: | ||
| raise | ||
| logger.warning("Reconnecting to MySQL server.") | ||
| connect_host_hook(self) | ||
| self.connect() | ||
| if self._in_transaction: | ||
| self.cancel_transaction() | ||
| raise errors.LostConnectionError( | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,16 +18,14 @@ dependencies = [ | |
| "pydot", | ||
| "minio>=7.0.0", | ||
| "matplotlib", | ||
| "otumat", | ||
| "faker", | ||
| "cryptography", | ||
| "urllib3", | ||
| "setuptools", | ||
| ] | ||
| requires-python = ">=3.9,<4.0" | ||
| authors = [ | ||
| {name = "Dimitri Yatsenko", email = "[email protected]"}, | ||
| {name = "Thinh Nguen", email = "[email protected]"} | ||
| {name = "Thinh Nguen", email = "[email protected]"}, | ||
dimitri-yatsenko marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {name = "Raphael Guzman"}, | ||
| {name = "Edgar Walker"}, | ||
| {name = "DataJoint Contributors", email = "[email protected]"}, | ||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.