e6data-python-connector 2.2.3rc3__tar.gz → 2.2.3rc5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {e6data_python_connector-2.2.3rc3/e6data_python_connector.egg-info → e6data_python_connector-2.2.3rc5}/PKG-INFO +2 -2
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/README.md +1 -1
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/cluster_manager.py +7 -1
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/e6data_grpc.py +59 -24
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5/e6data_python_connector.egg-info}/PKG-INFO +2 -2
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/setup.py +1 -1
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/LICENSE +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/MANIFEST.in +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/__init__.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/cluster_server/__init__.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/cluster_server/cluster_pb2.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/cluster_server/cluster_pb2_grpc.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/common.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/constants.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/datainputstream.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/date_time_utils.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/dialect.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/e6x_vector/__init__.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/e6x_vector/constants.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/e6x_vector/ttypes.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/exceptions.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/QueryEngineService.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/__init__.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/constants.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/e6x_engine_pb2.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/e6x_engine_pb2.pyi +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/e6x_engine_pb2_grpc.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/ttypes.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/typeId.py +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector.egg-info/SOURCES.txt +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector.egg-info/dependency_links.txt +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector.egg-info/entry_points.txt +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector.egg-info/requires.txt +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector.egg-info/top_level.txt +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/pyproject.toml +0 -0
- {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: e6data-python-connector
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3rc5
|
|
4
4
|
Summary: Client for the e6data distributed SQL Engine.
|
|
5
5
|
Home-page: https://github.com/e6x-labs/e6data-python-connector
|
|
6
6
|
Author: e6data, Inc.
|
|
@@ -38,7 +38,7 @@ Dynamic: summary
|
|
|
38
38
|
|
|
39
39
|
# e6data Python Connector
|
|
40
40
|
|
|
41
|
-

|
|
42
42
|
|
|
43
43
|
## Introduction
|
|
44
44
|
|
|
@@ -220,6 +220,7 @@ class ClusterManager:
|
|
|
220
220
|
payload,
|
|
221
221
|
metadata=_get_grpc_header(cluster=self.cluster_uuid)
|
|
222
222
|
)
|
|
223
|
+
print(f'Cluster resume response: {response}')
|
|
223
224
|
elif current_status.status == 'active':
|
|
224
225
|
return True
|
|
225
226
|
elif current_status.status != 'resuming':
|
|
@@ -227,6 +228,7 @@ class ClusterManager:
|
|
|
227
228
|
If cluster cannot be resumed due to its current state,
|
|
228
229
|
or already in a process of resuming, terminate the operation.
|
|
229
230
|
"""
|
|
231
|
+
print(f'Cluster is not suspended status, raising error.')
|
|
230
232
|
return False
|
|
231
233
|
|
|
232
234
|
# Wait for the cluster to become active
|
|
@@ -240,12 +242,16 @@ class ClusterManager:
|
|
|
240
242
|
status_payload,
|
|
241
243
|
metadata=_get_grpc_header(cluster=self.cluster_uuid)
|
|
242
244
|
)
|
|
245
|
+
print(f'Cluster status response: {response}')
|
|
243
246
|
if response.status == 'active':
|
|
247
|
+
print('Cluster is now active, starting execution.')
|
|
244
248
|
lock.set_active()
|
|
245
249
|
return True
|
|
246
|
-
if response.status in ['
|
|
250
|
+
if response.status in ['failed']:
|
|
251
|
+
print(f'Trying to resume the cluster, found status: {response.status}, raising error.')
|
|
247
252
|
return False
|
|
248
253
|
if time.time() > self._timeout:
|
|
254
|
+
print('Cluster resume timed out.')
|
|
249
255
|
return False
|
|
250
256
|
except _InactiveRpcError as e:
|
|
251
257
|
pass
|
|
@@ -80,11 +80,12 @@ def re_auth(func):
|
|
|
80
80
|
raise e
|
|
81
81
|
if e.code() == grpc.StatusCode.INTERNAL and 'Access denied' in e.details():
|
|
82
82
|
time.sleep(0.2)
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
_logger.info(f'RE_AUTH: Function Name: {func}')
|
|
84
|
+
_logger.info(f'RE_AUTH: Error Found {e}')
|
|
85
85
|
self.connection.get_re_authenticate_session_id()
|
|
86
86
|
else:
|
|
87
87
|
raise e
|
|
88
|
+
|
|
88
89
|
return wrapper
|
|
89
90
|
|
|
90
91
|
|
|
@@ -173,6 +174,7 @@ class Connection(object):
|
|
|
173
174
|
- max_receive_message_length: This parameter sets the maximum allowed size (in bytes) for incoming messages on the gRPC server.
|
|
174
175
|
- max_send_message_length: Similar to max_receive_message_length, this parameter sets the maximum allowed size (in bytes) for outgoing messages from the gRPC client
|
|
175
176
|
- grpc_prepare_timeout: Timeout for prepare statement API call (default to 10 minutes).
|
|
177
|
+
- keepalive_time_ms: This parameter defines the time, in milliseconds, Default to 30 seconds
|
|
176
178
|
"""
|
|
177
179
|
if not username or not password:
|
|
178
180
|
raise ValueError("username or password cannot be empty.")
|
|
@@ -192,43 +194,76 @@ class Connection(object):
|
|
|
192
194
|
|
|
193
195
|
self._auto_resume = auto_resume
|
|
194
196
|
|
|
195
|
-
self.
|
|
196
|
-
self.
|
|
197
|
-
|
|
198
|
-
self.grpc_prepare_timeout = 10 * 60 # 10 minutes
|
|
199
|
-
|
|
200
|
-
if isinstance(grpc_options, dict):
|
|
201
|
-
self._keepalive_timeout_ms = grpc_options.get('keepalive_timeout_ms') or self._keepalive_timeout_ms
|
|
202
|
-
self._max_receive_message_length = grpc_options.get(
|
|
203
|
-
'max_receive_message_length') or self._max_receive_message_length
|
|
204
|
-
self._max_send_message_length = grpc_options.get('max_send_message_length') or self._max_send_message_length
|
|
205
|
-
self.grpc_prepare_timeout = grpc_options.get('grpc_prepare_timeout') or self.grpc_prepare_timeout
|
|
197
|
+
self._grpc_options = grpc_options
|
|
198
|
+
if self._grpc_options is None:
|
|
199
|
+
self._grpc_options = dict()
|
|
200
|
+
self.grpc_prepare_timeout = self._grpc_options.get('grpc_prepare_timeout') or 10 * 60 # 10 minutes
|
|
206
201
|
self._create_client()
|
|
207
202
|
|
|
203
|
+
@property
|
|
204
|
+
def _get_grpc_options(self):
|
|
205
|
+
"""
|
|
206
|
+
Property to get gRPC options for the connection.
|
|
207
|
+
|
|
208
|
+
This method checks if the gRPC options are already cached. If not, it creates a copy of the
|
|
209
|
+
provided gRPC options and merges them with the default options. The merged options are then
|
|
210
|
+
cached for future use.
|
|
211
|
+
|
|
212
|
+
Returns:
|
|
213
|
+
list: A list of tuples containing gRPC options.
|
|
214
|
+
"""
|
|
215
|
+
if not hasattr(self, '_cached_grpc_options'):
|
|
216
|
+
grpc_options = self._grpc_options.copy()
|
|
217
|
+
default_options = {
|
|
218
|
+
"keepalive_timeout_ms": 900000, # Time in milliseconds to keep the connection alive.
|
|
219
|
+
"max_receive_message_length": -1, # Maximum size of received messages.
|
|
220
|
+
"max_send_message_length": 300 * 1024 * 1024, # Maximum size of sent messages (300 MB).
|
|
221
|
+
"grpc_prepare_timeout": self.grpc_prepare_timeout, # Timeout for prepare statement API call.
|
|
222
|
+
"keepalive_time_ms": 30000, # Time in milliseconds between keep-alive pings.
|
|
223
|
+
"keepalive_permit_without_calls": 1, # Allow keep-alives with no active RPCs.
|
|
224
|
+
"http2.max_pings_without_data": 0, # Unlimited pings without data.
|
|
225
|
+
"http2.min_time_between_pings_ms": 15000, # Minimum time between pings (15 seconds).
|
|
226
|
+
"http2.min_ping_interval_without_data_ms": 15000, # Minimum interval between pings without data (15 seconds).
|
|
227
|
+
}
|
|
228
|
+
if grpc_options:
|
|
229
|
+
for key, value in grpc_options.items():
|
|
230
|
+
default_options[key] = value
|
|
231
|
+
|
|
232
|
+
self._cached_grpc_options = [(f'grpc.{key}', value) for key, value in default_options.items()]
|
|
233
|
+
|
|
234
|
+
return self._cached_grpc_options
|
|
235
|
+
|
|
208
236
|
def _create_client(self):
|
|
237
|
+
"""
|
|
238
|
+
Creates a gRPC client for the connection.
|
|
239
|
+
|
|
240
|
+
This method initializes a gRPC channel based on whether a secure channel is required or not.
|
|
241
|
+
It then creates a client stub for the QueryEngineService.
|
|
242
|
+
|
|
243
|
+
If the secure channel is enabled, it uses `grpc.secure_channel` with SSL credentials.
|
|
244
|
+
Otherwise, it uses `grpc.insecure_channel`.
|
|
245
|
+
|
|
246
|
+
The gRPC options are retrieved from the `_get_grpc_options` property.
|
|
247
|
+
|
|
248
|
+
Raises:
|
|
249
|
+
grpc.RpcError: If there is an error in creating the gRPC channel or client stub.
|
|
250
|
+
"""
|
|
209
251
|
if self._secure_channel:
|
|
210
252
|
self._channel = grpc.secure_channel(
|
|
211
253
|
target='{}:{}'.format(self._host, self._port),
|
|
212
|
-
options=
|
|
213
|
-
("grpc.keepalive_timeout_ms", self._keepalive_timeout_ms),
|
|
214
|
-
('grpc.max_send_message_length', self._max_send_message_length),
|
|
215
|
-
('grpc.max_receive_message_length', self._max_receive_message_length)
|
|
216
|
-
],
|
|
254
|
+
options=self._get_grpc_options,
|
|
217
255
|
credentials=grpc.ssl_channel_credentials()
|
|
218
256
|
)
|
|
219
257
|
else:
|
|
220
258
|
self._channel = grpc.insecure_channel(
|
|
221
259
|
target='{}:{}'.format(self._host, self._port),
|
|
222
|
-
options=
|
|
223
|
-
("grpc.keepalive_timeout_ms", self._keepalive_timeout_ms),
|
|
224
|
-
('grpc.max_send_message_length', self._max_send_message_length),
|
|
225
|
-
('grpc.max_receive_message_length', self._max_receive_message_length)
|
|
226
|
-
]
|
|
260
|
+
options=self._get_grpc_options
|
|
227
261
|
)
|
|
228
262
|
self._client = e6x_engine_pb2_grpc.QueryEngineServiceStub(self._channel)
|
|
229
263
|
|
|
230
264
|
def get_re_authenticate_session_id(self):
|
|
231
|
-
self.
|
|
265
|
+
self.close()
|
|
266
|
+
self._create_client()
|
|
232
267
|
return self.get_session_id
|
|
233
268
|
|
|
234
269
|
@property
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: e6data-python-connector
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3rc5
|
|
4
4
|
Summary: Client for the e6data distributed SQL Engine.
|
|
5
5
|
Home-page: https://github.com/e6x-labs/e6data-python-connector
|
|
6
6
|
Author: e6data, Inc.
|
|
@@ -38,7 +38,7 @@ Dynamic: summary
|
|
|
38
38
|
|
|
39
39
|
# e6data Python Connector
|
|
40
40
|
|
|
41
|
-

|
|
42
42
|
|
|
43
43
|
## Introduction
|
|
44
44
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|