e6data-python-connector 2.3.9rc11__tar.gz → 2.3.10rc2__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 (77) hide show
  1. {e6data_python_connector-2.3.9rc11/e6data_python_connector.egg-info → e6data_python_connector-2.3.10rc2}/PKG-INFO +3 -3
  2. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/README.md +1 -1
  3. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/cluster_manager.py +1 -1
  4. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/e6data_grpc.py +49 -26
  5. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2/e6data_python_connector.egg-info}/PKG-INFO +3 -3
  6. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector.egg-info/requires.txt +1 -1
  7. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/setup.py +2 -2
  8. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/LICENSE +0 -0
  9. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/MANIFEST.in +0 -0
  10. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/__init__.py +0 -0
  11. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/cluster_server/__init__.py +0 -0
  12. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/cluster_server/cluster_pb2.py +0 -0
  13. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/cluster_server/cluster_pb2_grpc.py +0 -0
  14. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/common.py +0 -0
  15. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/constants.py +0 -0
  16. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/datainputstream.py +0 -0
  17. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/date_time_utils.py +0 -0
  18. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/dialect.py +0 -0
  19. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/e6x_vector/__init__.py +0 -0
  20. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/e6x_vector/constants.py +0 -0
  21. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/e6x_vector/ttypes.py +0 -0
  22. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/exceptions.py +0 -0
  23. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/server/QueryEngineService.py +0 -0
  24. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/server/__init__.py +0 -0
  25. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/server/constants.py +0 -0
  26. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/server/e6x_engine_pb2.py +0 -0
  27. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/server/e6x_engine_pb2.pyi +0 -0
  28. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/server/e6x_engine_pb2_grpc.py +0 -0
  29. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/server/ttypes.py +0 -0
  30. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/strategy.py +0 -0
  31. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector/typeId.py +0 -0
  32. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector.egg-info/SOURCES.txt +0 -0
  33. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector.egg-info/dependency_links.txt +0 -0
  34. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector.egg-info/entry_points.txt +0 -0
  35. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/e6data_python_connector.egg-info/top_level.txt +0 -0
  36. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/pyproject.toml +0 -0
  37. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/setup.cfg +0 -0
  38. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/__init__.py +0 -0
  39. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/analyze_38_nines.py +0 -0
  40. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/analyze_all_cases.py +0 -0
  41. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/analyze_binary.py +0 -0
  42. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/analyze_correct_value.py +0 -0
  43. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/analyze_fields.py +0 -0
  44. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/check_decimal_errors.py +0 -0
  45. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/cleanup_test_files.py +0 -0
  46. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/debug_38_nines.py +0 -0
  47. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/debug_binary.py +0 -0
  48. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/final_test.py +0 -0
  49. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/move_tests.py +0 -0
  50. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/quick_test.py +0 -0
  51. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_38_nines.py +0 -0
  52. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_all_decimal128_cases.py +0 -0
  53. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_cluster_manager_efficiency.py +0 -0
  54. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_cluster_manager_none_strategy.py +0 -0
  55. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_cluster_manager_strategy.py +0 -0
  56. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_comprehensive.py +0 -0
  57. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_current_implementation.py +0 -0
  58. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_decimal128_binary_parsing.py +0 -0
  59. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_decimal128_parsing.py +0 -0
  60. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_fix.py +0 -0
  61. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_improved_parsing.py +0 -0
  62. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_known_case.py +0 -0
  63. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_manual_analysis.py +0 -0
  64. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_mock_server.py +0 -0
  65. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_multiprocessing_fix.py +0 -0
  66. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_new_implementation.py +0 -0
  67. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_specific_binary.py +0 -0
  68. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_strategy.py +0 -0
  69. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_strategy_logic.py +0 -0
  70. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_strategy_persistence_fix.py +0 -0
  71. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_strategy_sharing_fix.py +0 -0
  72. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/test_user_binary_value.py +0 -0
  73. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/tests.py +0 -0
  74. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/tests_grpc.py +0 -0
  75. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/validate_decimal128.py +0 -0
  76. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/validate_implementation.py +0 -0
  77. {e6data_python_connector-2.3.9rc11 → e6data_python_connector-2.3.10rc2}/test/verify_decimal_fix.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: e6data-python-connector
3
- Version: 2.3.9rc11
3
+ Version: 2.3.10rc2
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.
@@ -24,7 +24,7 @@ Requires-Dist: python-dateutil==2.9.0.post0
24
24
  Requires-Dist: pycryptodome==3.19.1
25
25
  Requires-Dist: pytz==2024.1
26
26
  Requires-Dist: thrift==0.20.0
27
- Requires-Dist: grpcio>=1.74.0
27
+ Requires-Dist: grpcio==1.65.1
28
28
  Requires-Dist: grpcio-tools
29
29
  Dynamic: author
30
30
  Dynamic: author-email
@@ -38,7 +38,7 @@ Dynamic: summary
38
38
 
39
39
  # e6data Python Connector
40
40
 
41
- ![version](https://img.shields.io/badge/version-2.3.9rc11-blue.svg)
41
+ ![version](https://img.shields.io/badge/version-2.3.10,rc2-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.3.9rc11-blue.svg)
3
+ ![version](https://img.shields.io/badge/version-2.3.10,rc2-blue.svg)
4
4
 
5
5
  ## Introduction
6
6
 
@@ -365,7 +365,7 @@ class ClusterManager:
365
365
  # Retrieve the current cluster status with strategy header
366
366
  try:
367
367
  current_status = self._try_cluster_request("status")
368
- except _InactiveRpcError as e:
368
+ except _InactiveRpcError:
369
369
  return False
370
370
  if current_status.status == 'suspended':
371
371
  # Send the resume request with strategy header
@@ -14,7 +14,6 @@ from decimal import Decimal
14
14
  from io import BytesIO
15
15
  from ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
16
16
  import threading
17
- import multiprocessing
18
17
 
19
18
  import grpc
20
19
  from grpc._channel import _InactiveRpcError
@@ -26,6 +25,9 @@ from e6data_python_connector.constants import *
26
25
  from e6data_python_connector.datainputstream import get_query_columns_info, read_rows_from_chunk
27
26
  from e6data_python_connector.server import e6x_engine_pb2_grpc, e6x_engine_pb2
28
27
  from e6data_python_connector.typeId import *
28
+ import logging
29
+
30
+ _logger = logging.getLogger(__name__)
29
31
 
30
32
  apilevel = '2.0'
31
33
  threadsafety = 2 # Threads may share the e6xdb and connections.
@@ -134,17 +136,7 @@ _debug_connections = set()
134
136
  def _strategy_debug_log(message):
135
137
  """Log strategy debug messages if any connection has debug enabled."""
136
138
  if _debug_connections:
137
- print(f"[E6DATA_STRATEGY_DEBUG] {time.strftime('%Y-%m-%d %H:%M:%S')} - {message}")
138
-
139
-
140
- def _get_normalised_strategy_with_validate(strategy):
141
- if not strategy:
142
- return False
143
- # Normalize strategy to lowercase and validate
144
- normalized_strategy = strategy.lower()
145
- if normalized_strategy not in ['blue', 'green']:
146
- return False
147
- return normalized_strategy
139
+ _logger.debug(f"[E6DATA_STRATEGY_DEBUG] {time.strftime('%Y-%m-%d %H:%M:%S')} - {message}")
148
140
 
149
141
 
150
142
  def _get_shared_strategy():
@@ -167,8 +159,11 @@ def _get_active_strategy():
167
159
 
168
160
  def _set_active_strategy(strategy):
169
161
  """Set the active deployment strategy in shared memory."""
170
- normalized_strategy = _get_normalised_strategy_with_validate(strategy)
171
- if not normalized_strategy:
162
+ if not strategy:
163
+ return
164
+ # Normalize strategy to lowercase and validate
165
+ normalized_strategy = strategy.lower()
166
+ if normalized_strategy not in ['blue', 'green']:
172
167
  return
173
168
 
174
169
  with _strategy_lock:
@@ -201,8 +196,11 @@ def _clear_strategy_cache():
201
196
 
202
197
  def _set_pending_strategy(strategy):
203
198
  """Set the pending strategy to be used for the next query."""
204
- normalized_strategy = _get_normalised_strategy_with_validate(strategy)
205
- if not normalized_strategy:
199
+ if not strategy:
200
+ return
201
+ # Normalize strategy to lowercase and validate
202
+ normalized_strategy = strategy.lower()
203
+ if normalized_strategy not in ['blue', 'green']:
206
204
  return
207
205
 
208
206
  with _strategy_lock:
@@ -247,8 +245,11 @@ def _invalidate_all_sessions():
247
245
 
248
246
  def _register_query_strategy(query_id, strategy):
249
247
  """Register the strategy used for a specific query."""
250
- normalized_strategy = _get_normalised_strategy_with_validate(strategy)
251
- if not normalized_strategy:
248
+ if not query_id or not strategy:
249
+ return
250
+ # Normalize strategy to lowercase and validate
251
+ normalized_strategy = strategy.lower()
252
+ if normalized_strategy not in ['blue', 'green']:
252
253
  return
253
254
 
254
255
  with _strategy_lock:
@@ -373,6 +374,7 @@ class Connection(object):
373
374
  self.database = database
374
375
  self.cluster_name = cluster_name
375
376
  self._session_id = None
377
+ self._session_strategy = None # Track which strategy was used for current session
376
378
  self._host = host
377
379
  self._port = port
378
380
 
@@ -495,6 +497,7 @@ class Connection(object):
495
497
  # Check if session was invalidated globally
496
498
  if self._session_id and session_invalidated:
497
499
  self._session_id = None
500
+ self._session_strategy = None
498
501
  self.close()
499
502
  self._create_client()
500
503
  # Clear the invalidation flag
@@ -508,8 +511,18 @@ class Connection(object):
508
511
  _apply_pending_strategy()
509
512
  # Force complete reconnection with new strategy
510
513
  self._session_id = None
514
+ self._session_strategy = None
511
515
  self.close()
512
516
  self._create_client()
517
+
518
+ # Check if session strategy matches current active strategy
519
+ elif self._session_id and self._session_strategy and self._session_strategy != _get_active_strategy():
520
+ # Session was created with different strategy, need to re-authenticate
521
+ _strategy_debug_log(f"Session strategy mismatch: session created with {self._session_strategy}, current active is {_get_active_strategy()}")
522
+ self._session_id = None
523
+ self._session_strategy = None
524
+ self.close()
525
+ self._create_client()
513
526
 
514
527
  if not self._session_id:
515
528
  try:
@@ -534,14 +547,16 @@ class Connection(object):
534
547
  self._session_id = authenticate_response.sessionId
535
548
  if not self._session_id:
536
549
  raise ValueError("Invalid credentials.")
550
+ # Track which strategy was used for this session
551
+ self._session_strategy = active_strategy
537
552
  # Check for new strategy in authenticate response
538
553
  if hasattr(authenticate_response, 'new_strategy') and authenticate_response.new_strategy:
539
554
  new_strategy = authenticate_response.new_strategy.lower()
540
- normalized_strategy = _get_normalised_strategy_with_validate(new_strategy)
541
- if normalized_strategy and normalized_strategy != active_strategy:
542
- _set_pending_strategy(normalized_strategy)
555
+ if new_strategy != active_strategy:
556
+ _set_pending_strategy(new_strategy)
543
557
  _apply_pending_strategy()
544
558
  self._session_id = None
559
+ self._session_strategy = None
545
560
  self.close()
546
561
  self._create_client()
547
562
  return self.get_session_id
@@ -581,17 +596,19 @@ class Connection(object):
581
596
  # Success! Cache this strategy
582
597
  _strategy_debug_log(f"Authentication successful with strategy: {strategy}")
583
598
  _set_active_strategy(strategy)
599
+ # Track which strategy was used for this session
600
+ self._session_strategy = strategy
584
601
 
585
602
  # Check for new strategy in authenticate response
586
603
  if hasattr(authenticate_response, 'new_strategy') and authenticate_response.new_strategy:
587
604
  new_strategy = authenticate_response.new_strategy.lower()
588
- normalized_strategy = _get_normalised_strategy_with_validate(new_strategy)
589
- if normalized_strategy and normalized_strategy != active_strategy:
605
+ if new_strategy != strategy:
590
606
  _set_pending_strategy(new_strategy)
591
607
  _apply_pending_strategy()
592
608
  self.close()
593
609
  self._create_client()
594
610
  self._session_id = None
611
+ self._session_strategy = None
595
612
  return self.get_session_id
596
613
  break
597
614
  except _InactiveRpcError as e:
@@ -622,7 +639,6 @@ class Connection(object):
622
639
  cluster_uuid=self.cluster_name,
623
640
  timeout=self.grpc_auto_resume_timeout_seconds
624
641
  ).resume()
625
- print('starus', status)
626
642
  if status:
627
643
  return self.get_session_id
628
644
  else:
@@ -670,6 +686,7 @@ class Connection(object):
670
686
  self._channel.close()
671
687
  self._channel = None
672
688
  self._session_id = None
689
+ self._session_strategy = None
673
690
 
674
691
  # Remove from debug connections if debug was enabled
675
692
  if self._debug:
@@ -961,8 +978,14 @@ class Cursor(DBAPICursor):
961
978
  Returns:
962
979
  list: A list of tuples containing gRPC metadata.
963
980
  """
964
- # Use query-specific strategy if available, otherwise use active strategy
965
- strategy = _get_query_strategy(self._query_id) if self._query_id else _get_active_strategy()
981
+ # Use query-specific strategy if available, otherwise use session strategy, otherwise use active strategy
982
+ if self._query_id:
983
+ strategy = _get_query_strategy(self._query_id)
984
+ elif self.connection._session_strategy:
985
+ # Use the strategy that was used to create the current session
986
+ strategy = self.connection._session_strategy
987
+ else:
988
+ strategy = _get_active_strategy()
966
989
  return _get_grpc_header(engine_ip=self._engine_ip, cluster=self.connection.cluster_name, strategy=strategy)
967
990
 
968
991
  @property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: e6data-python-connector
3
- Version: 2.3.9rc11
3
+ Version: 2.3.10rc2
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.
@@ -24,7 +24,7 @@ Requires-Dist: python-dateutil==2.9.0.post0
24
24
  Requires-Dist: pycryptodome==3.19.1
25
25
  Requires-Dist: pytz==2024.1
26
26
  Requires-Dist: thrift==0.20.0
27
- Requires-Dist: grpcio>=1.74.0
27
+ Requires-Dist: grpcio==1.65.1
28
28
  Requires-Dist: grpcio-tools
29
29
  Dynamic: author
30
30
  Dynamic: author-email
@@ -38,7 +38,7 @@ Dynamic: summary
38
38
 
39
39
  # e6data Python Connector
40
40
 
41
- ![version](https://img.shields.io/badge/version-2.3.9rc11-blue.svg)
41
+ ![version](https://img.shields.io/badge/version-2.3.10,rc2-blue.svg)
42
42
 
43
43
  ## Introduction
44
44
 
@@ -4,5 +4,5 @@ python-dateutil==2.9.0.post0
4
4
  pycryptodome==3.19.1
5
5
  pytz==2024.1
6
6
  thrift==0.20.0
7
- grpcio>=1.74.0
7
+ grpcio==1.65.1
8
8
  grpcio-tools
@@ -12,7 +12,7 @@
12
12
 
13
13
  import setuptools
14
14
 
15
- VERSION = (2, 3, 9, 'rc11',)
15
+ VERSION = (2, 3, 10, 'rc2')
16
16
 
17
17
 
18
18
  def get_long_desc():
@@ -49,7 +49,7 @@ setuptools.setup(
49
49
  'pycryptodome==3.19.1',
50
50
  'pytz==2024.1',
51
51
  'thrift==0.20.0',
52
- 'grpcio>=1.74.0',
52
+ 'grpcio==1.65.1',
53
53
  'grpcio-tools',
54
54
  ],
55
55
  classifiers=[