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.
Files changed (36) hide show
  1. {e6data_python_connector-2.2.3rc3/e6data_python_connector.egg-info → e6data_python_connector-2.2.3rc5}/PKG-INFO +2 -2
  2. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/README.md +1 -1
  3. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/cluster_manager.py +7 -1
  4. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/e6data_grpc.py +59 -24
  5. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5/e6data_python_connector.egg-info}/PKG-INFO +2 -2
  6. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/setup.py +1 -1
  7. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/LICENSE +0 -0
  8. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/MANIFEST.in +0 -0
  9. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/__init__.py +0 -0
  10. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/cluster_server/__init__.py +0 -0
  11. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/cluster_server/cluster_pb2.py +0 -0
  12. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/cluster_server/cluster_pb2_grpc.py +0 -0
  13. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/common.py +0 -0
  14. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/constants.py +0 -0
  15. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/datainputstream.py +0 -0
  16. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/date_time_utils.py +0 -0
  17. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/dialect.py +0 -0
  18. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/e6x_vector/__init__.py +0 -0
  19. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/e6x_vector/constants.py +0 -0
  20. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/e6x_vector/ttypes.py +0 -0
  21. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/exceptions.py +0 -0
  22. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/QueryEngineService.py +0 -0
  23. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/__init__.py +0 -0
  24. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/constants.py +0 -0
  25. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/e6x_engine_pb2.py +0 -0
  26. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/e6x_engine_pb2.pyi +0 -0
  27. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/e6x_engine_pb2_grpc.py +0 -0
  28. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/server/ttypes.py +0 -0
  29. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector/typeId.py +0 -0
  30. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector.egg-info/SOURCES.txt +0 -0
  31. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector.egg-info/dependency_links.txt +0 -0
  32. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector.egg-info/entry_points.txt +0 -0
  33. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector.egg-info/requires.txt +0 -0
  34. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/e6data_python_connector.egg-info/top_level.txt +0 -0
  35. {e6data_python_connector-2.2.3rc3 → e6data_python_connector-2.2.3rc5}/pyproject.toml +0 -0
  36. {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.3rc3
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
- ![version](https://img.shields.io/badge/version-2.2.3rc3-blue.svg)
41
+ ![version](https://img.shields.io/badge/version-2.2.3rc5-blue.svg)
42
42
 
43
43
  ## Introduction
44
44
 
@@ -1,6 +1,6 @@
1
1
  # e6data Python Connector
2
2
 
3
- ![version](https://img.shields.io/badge/version-2.2.3rc3-blue.svg)
3
+ ![version](https://img.shields.io/badge/version-2.2.3rc5-blue.svg)
4
4
 
5
5
  ## Introduction
6
6
 
@@ -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 ['suspended', 'failed']:
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
- print(f'RE_AUTH: Function Name: {func}')
84
- print(f'RE_AUTH: Error Found {e}')
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._keepalive_timeout_ms = 900000
196
- self._max_receive_message_length = -1
197
- self._max_send_message_length = 300 * 1024 * 1024 # mb
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._session_id = None
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.3rc3
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
- ![version](https://img.shields.io/badge/version-2.2.3rc3-blue.svg)
41
+ ![version](https://img.shields.io/badge/version-2.2.3rc5-blue.svg)
42
42
 
43
43
  ## Introduction
44
44
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  import setuptools
14
14
 
15
- VERSION = (2, 2, 3, 'rc3')
15
+ VERSION = (2, 2, 3, 'rc5')
16
16
 
17
17
 
18
18
  def get_long_desc():