You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,10 @@
2
2
3
3
## [Unreleased]
4
4
5
+
## [0.27.0] - 2024-09-09
6
+
5
7
- Relocked dependencies (Internal)
8
+
-[#151](https://github.com/exasol/pyexasol/issues/151): Added option to deactivate hostname resolution
6
9
7
10
## [0.26.0] - 2024-07-04
8
11
@@ -12,9 +15,9 @@
12
15
13
16
This driver facade should only be used if one is certain that using the dbapi2 is the right solution for their scenario, taking all implications into account. For more details on why and who should avoid using dbapi2, please refer to the [DBAPI2 compatibility section](/docs/DBAPI_COMPAT.md) in our documentation.
14
17
15
-
-Droped support for python 3.7
16
-
-Droped support for Exasol 6.x
17
-
-Droped support for Exasol 7.0.x
18
+
-Dropped support for python 3.7
19
+
-Dropped support for Exasol 6.x
20
+
-Dropped support for Exasol 7.0.x
18
21
- Relocked dependencies (Internal)
19
22
- Switched packaging and project workflow to poetry (internal)
Copy file name to clipboardExpand all lines: docs/REFERENCE.md
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,7 @@ Open new connection and return `ExaConnection` object.
114
114
|`udf_output_connect_address`|`('udf_host', 8580)`| Specific SCRIPT_OUTPUT_ADDRESS value to connect from Exasol to UDF script output server (Default: inherited from TCP server) |
115
115
|`udf_output_dir`|`/tmp`| Path or path-like object pointing to directory for script output log files (Default: `tempfile.gettempdir()`) |
116
116
|`http_proxy`|`http://myproxy.com:3128`| HTTP proxy string in Linux [`http_proxy`](https://www.shellhacks.com/linux-proxy-server-settings-set-proxy-command-line/) format (Default: `None`) |
117
+
|`resolve_hostnames`|`False`| Explicitly resolve host names to IP addresses before connecting. Deactivating this will let the operating system resolve the host name (Default: `True`) |
117
118
|`client_name`|`MyClient`| Custom name of client application displayed in Exasol sessions tables (Default: `PyEXASOL`) |
118
119
|`client_version`|`1.0.0`| Custom version of client application (Default: `pyexasol.__version__`) |
119
120
|`client_os_username`|`john`| Custom OS username displayed in Exasol sessions table (Default: `getpass.getuser()`) |
@@ -122,6 +123,12 @@ Open new connection and return `ExaConnection` object.
122
123
|`access_token`|`...`| OpenID access token to use for the login process |
123
124
|`refresh_token`|`...`| OpenID refresh token to use for the login process |
124
125
126
+
### Host Name Resolution
127
+
128
+
By default pyexasol resolves host names to IP addresses, randomly shuffles the IP addresses and tries to connect until connection succeeds. See the [design documentation](/docs/DESIGN.md#automatic-resolution-and-randomization-of-connection-addresses) for details.
129
+
130
+
If host name resolution causes problems, you can deactivate it by specifying argument `resolve_hostnames=False`. This may be required when connecting through a proxy that allows connections only to defined host names. In all other cases we recommend to omit the argument.
131
+
125
132
## connect_local_config()
126
133
Open new connection and return `ExaConnection` object using local .ini file (usually `~/.pyexasol.ini`) to read credentials and connection parameters. Please read [local config](/docs/LOCAL_CONFIG.md) page for more details.
Copy file name to clipboardExpand all lines: pyexasol/connection.py
+55-24Lines changed: 55 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,10 @@
16
16
17
17
from . importcallbackascb
18
18
19
+
fromtypingimport (
20
+
NamedTuple,
21
+
Optional
22
+
)
19
23
from .exceptionsimport*
20
24
from .statementimportExaStatement
21
25
from .loggerimportExaLogger
@@ -27,6 +31,13 @@
27
31
from .versionimport__version__
28
32
29
33
34
+
classHost(NamedTuple):
35
+
"""This represents a resolved host name with its IP address and port number."""
36
+
hostname: str
37
+
ip_address: Optional[str]
38
+
port: int
39
+
fingerprint: Optional[str]
40
+
30
41
classExaConnection(object):
31
42
cls_statement=ExaStatement
32
43
cls_formatter=ExaFormatter
@@ -69,6 +80,7 @@ def __init__(self
69
80
, udf_output_connect_address=None
70
81
, udf_output_dir=None
71
82
, http_proxy=None
83
+
, resolve_hostnames=True
72
84
, client_name=None
73
85
, client_version=None
74
86
, client_os_username=None
@@ -104,6 +116,7 @@ def __init__(self
104
116
:param udf_output_connect_address: Specific SCRIPT_OUTPUT_ADDRESS value to connect from Exasol to UDF script output server (default: inherited from TCP server)
105
117
:param udf_output_dir: Directory to store captured UDF script output logs, split by <session_id>_<statement_id>/<vm_num>
106
118
:param http_proxy: HTTP proxy string in Linux http_proxy format (default: None)
119
+
:param resolve_hostnames: Explicitly resolve host names to IP addresses before connecting. Deactivating this will let the operating system resolve the host name (default: True)
107
120
:param client_name: Custom name of client application displayed in Exasol sessions tables (Default: PyEXASOL)
108
121
:param client_version: Custom version of client application (Default: pyexasol.__version__)
109
122
:param client_os_username: Custom OS username displayed in Exasol sessions table (Default: getpass.getuser())
0 commit comments