e6data-python-connector 2.3.10rc3__tar.gz → 2.3.10rc5__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.10rc3/e6data_python_connector.egg-info → e6data_python_connector-2.3.10rc5}/PKG-INFO +2 -2
  2. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/README.md +1 -1
  3. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/e6data_grpc.py +78 -30
  4. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5/e6data_python_connector.egg-info}/PKG-INFO +2 -2
  5. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/setup.py +1 -1
  6. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/LICENSE +0 -0
  7. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/MANIFEST.in +0 -0
  8. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/__init__.py +0 -0
  9. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/cluster_manager.py +0 -0
  10. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/cluster_server/__init__.py +0 -0
  11. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/cluster_server/cluster_pb2.py +0 -0
  12. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/cluster_server/cluster_pb2_grpc.py +0 -0
  13. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/common.py +0 -0
  14. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/constants.py +0 -0
  15. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/datainputstream.py +0 -0
  16. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/date_time_utils.py +0 -0
  17. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/dialect.py +0 -0
  18. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/e6x_vector/__init__.py +0 -0
  19. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/e6x_vector/constants.py +0 -0
  20. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/e6x_vector/ttypes.py +0 -0
  21. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/exceptions.py +0 -0
  22. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/server/QueryEngineService.py +0 -0
  23. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/server/__init__.py +0 -0
  24. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/server/constants.py +0 -0
  25. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/server/e6x_engine_pb2.py +0 -0
  26. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/server/e6x_engine_pb2.pyi +0 -0
  27. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/server/e6x_engine_pb2_grpc.py +0 -0
  28. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/server/ttypes.py +0 -0
  29. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/strategy.py +0 -0
  30. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector/typeId.py +0 -0
  31. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector.egg-info/SOURCES.txt +0 -0
  32. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector.egg-info/dependency_links.txt +0 -0
  33. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector.egg-info/entry_points.txt +0 -0
  34. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector.egg-info/requires.txt +0 -0
  35. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/e6data_python_connector.egg-info/top_level.txt +0 -0
  36. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/pyproject.toml +0 -0
  37. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/setup.cfg +0 -0
  38. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/__init__.py +0 -0
  39. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/analyze_38_nines.py +0 -0
  40. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/analyze_all_cases.py +0 -0
  41. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/analyze_binary.py +0 -0
  42. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/analyze_correct_value.py +0 -0
  43. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/analyze_fields.py +0 -0
  44. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/check_decimal_errors.py +0 -0
  45. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/cleanup_test_files.py +0 -0
  46. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/debug_38_nines.py +0 -0
  47. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/debug_binary.py +0 -0
  48. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/final_test.py +0 -0
  49. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/move_tests.py +0 -0
  50. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/quick_test.py +0 -0
  51. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_38_nines.py +0 -0
  52. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_all_decimal128_cases.py +0 -0
  53. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_cluster_manager_efficiency.py +0 -0
  54. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_cluster_manager_none_strategy.py +0 -0
  55. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_cluster_manager_strategy.py +0 -0
  56. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_comprehensive.py +0 -0
  57. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_current_implementation.py +0 -0
  58. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_decimal128_binary_parsing.py +0 -0
  59. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_decimal128_parsing.py +0 -0
  60. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_fix.py +0 -0
  61. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_improved_parsing.py +0 -0
  62. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_known_case.py +0 -0
  63. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_manual_analysis.py +0 -0
  64. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_mock_server.py +0 -0
  65. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_multiprocessing_fix.py +0 -0
  66. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_new_implementation.py +0 -0
  67. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_specific_binary.py +0 -0
  68. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_strategy.py +0 -0
  69. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_strategy_logic.py +0 -0
  70. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_strategy_persistence_fix.py +0 -0
  71. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_strategy_sharing_fix.py +0 -0
  72. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/test_user_binary_value.py +0 -0
  73. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/tests.py +0 -0
  74. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/tests_grpc.py +0 -0
  75. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/validate_decimal128.py +0 -0
  76. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/test/validate_implementation.py +0 -0
  77. {e6data_python_connector-2.3.10rc3 → e6data_python_connector-2.3.10rc5}/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.10rc3
3
+ Version: 2.3.10rc5
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.3.10,rc3-blue.svg)
41
+ ![version](https://img.shields.io/badge/version-2.3.10,rc5-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.10,rc3-blue.svg)
3
+ ![version](https://img.shields.io/badge/version-2.3.10,rc5-blue.svg)
4
4
 
5
5
  ## Introduction
6
6
 
@@ -10,6 +10,7 @@ import datetime
10
10
  import re
11
11
  import sys
12
12
  import time
13
+ import uuid
13
14
  from decimal import Decimal
14
15
  from io import BytesIO
15
16
  from ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
@@ -80,10 +81,12 @@ def re_auth(func):
80
81
  if current_retry == max_retry:
81
82
  raise e
82
83
  if e.code() == grpc.StatusCode.INTERNAL and 'Access denied' in e.details():
84
+ _logger.debug(f'Re-authenticating due to {e}')
83
85
  time.sleep(0.2)
84
86
  self.connection.get_re_authenticate_session_id()
85
87
  elif 'status: 456' in e.details():
86
88
  # Strategy changed, clear cache and retry
89
+ _logger.debug(f'Re-authenticating due to status: 456')
87
90
  _clear_strategy_cache()
88
91
  # Force re-authentication which will detect new strategy
89
92
  self.connection.get_re_authenticate_session_id()
@@ -133,10 +136,15 @@ STRATEGY_CACHE_TIMEOUT = 300
133
136
  # Global set to track debug-enabled connections
134
137
  _debug_connections = set()
135
138
 
136
- def _strategy_debug_log(message):
139
+ def _generate_trace_id():
140
+ """Generate a unique trace ID for tracking requests across a session."""
141
+ return str(uuid.uuid4())[:8] # Use first 8 characters for readability
142
+
143
+ def _strategy_debug_log(message, trace_id=None):
137
144
  """Log strategy debug messages if any connection has debug enabled."""
138
145
  if _debug_connections:
139
- _logger.debug(f"[E6DATA_STRATEGY_DEBUG] {time.strftime('%Y-%m-%d %H:%M:%S')} - {message}")
146
+ trace_info = f"[{trace_id}] " if trace_id else ""
147
+ _logger.debug(f"[E6DATA_STRATEGY_DEBUG] {time.strftime('%Y-%m-%d %H:%M:%S')} - {trace_info}{message}")
140
148
 
141
149
 
142
150
  def _get_shared_strategy():
@@ -302,10 +310,18 @@ def _get_strategy_debug_info():
302
310
  }
303
311
 
304
312
 
305
- def _get_grpc_header(engine_ip=None, cluster=None, strategy=None):
313
+ def _get_grpc_header(engine_ip=None, cluster=None, strategy=None, session_id=None, request_type=None, trace_id=None):
306
314
  """Generate gRPC metadata headers for the request."""
307
315
  # Use the strategy module's implementation
308
- return _get_strategy_header(engine_ip=engine_ip, cluster=cluster, strategy=strategy)
316
+ headers = _get_strategy_header(engine_ip=engine_ip, cluster=cluster, strategy=strategy)
317
+
318
+ # Log headers being sent if debug connections exist
319
+ if _debug_connections:
320
+ session_info = f", session: {session_id}" if session_id else ""
321
+ request_info = f" [{request_type}]" if request_type else ""
322
+ _strategy_debug_log(f"Sending headers{request_info}: strategy={strategy}, cluster={cluster}, engine_ip={engine_ip}{session_info}", trace_id)
323
+
324
+ return headers
309
325
 
310
326
 
311
327
  def connect(*args, **kwargs):
@@ -377,6 +393,7 @@ class Connection(object):
377
393
  self.cluster_name = cluster_name
378
394
  self._session_id = None
379
395
  self._session_strategy = None # Track which strategy was used for current session
396
+ self._trace_id = _generate_trace_id() # Generate trace ID for this connection
380
397
  self._host = host
381
398
  self._port = port
382
399
 
@@ -401,7 +418,7 @@ class Connection(object):
401
418
  self._debug = debug
402
419
  if self._debug:
403
420
  _debug_connections.add(id(self))
404
- _strategy_debug_log(f"Debug mode enabled for connection {id(self)}")
421
+ _strategy_debug_log(f"Debug mode enabled for connection {id(self)}", self._trace_id)
405
422
 
406
423
  self._create_client()
407
424
 
@@ -520,11 +537,11 @@ class Connection(object):
520
537
  # Check if session strategy matches current active strategy
521
538
  elif self._session_id and self._session_strategy and self._session_strategy != _get_active_strategy():
522
539
  # Session was created with different strategy, need to re-authenticate
523
- _strategy_debug_log(f"Session strategy mismatch: session {self._session_id} created with {self._session_strategy}, current active is {_get_active_strategy()}")
540
+ _strategy_debug_log(f"Session strategy mismatch: session {self._session_id} created with {self._session_strategy}, current active is {_get_active_strategy()}", self._trace_id)
524
541
  old_session_id = self._session_id
525
542
  self._session_id = None
526
543
  self._session_strategy = None
527
- _strategy_debug_log(f"Invalidating session {old_session_id} due to strategy mismatch")
544
+ _strategy_debug_log(f"Invalidating session {old_session_id} due to strategy mismatch", self._trace_id)
528
545
  self.close()
529
546
  self._create_client()
530
547
 
@@ -542,18 +559,22 @@ class Connection(object):
542
559
 
543
560
  if active_strategy and not pending_strategy:
544
561
  # Use cached strategy only if there's no pending strategy
545
- _strategy_debug_log(f"Authenticating with cached strategy: {active_strategy} (session: {self._session_id})")
562
+ _strategy_debug_log(f"Authenticating with cached strategy: {active_strategy} (session: {self._session_id})", self._trace_id)
546
563
  try:
547
564
  authenticate_response = self._client.authenticate(
548
565
  authenticate_request,
549
- metadata=_get_grpc_header(cluster=self.cluster_name, strategy=active_strategy)
566
+ metadata=_get_grpc_header(cluster=self.cluster_name, strategy=active_strategy,
567
+ session_id=self._session_id, request_type="authenticate", trace_id=self._trace_id)
550
568
  )
551
569
  self._session_id = authenticate_response.sessionId
552
570
  if not self._session_id:
553
571
  raise ValueError("Invalid credentials.")
554
572
  # Track which strategy was used for this session
555
573
  self._session_strategy = active_strategy
556
- _strategy_debug_log(f"Authentication successful with strategy: {active_strategy}, session: {self._session_id}")
574
+ # Generate new trace ID for this authenticated session
575
+ old_trace_id = self._trace_id
576
+ self._trace_id = _generate_trace_id()
577
+ _strategy_debug_log(f"Authentication successful with strategy: {active_strategy}, session: {self._session_id}, new trace: {self._trace_id} (was: {old_trace_id})", self._trace_id)
557
578
  # Check for new strategy in authenticate response
558
579
  if hasattr(authenticate_response, 'new_strategy') and authenticate_response.new_strategy:
559
580
  new_strategy = authenticate_response.new_strategy.lower()
@@ -593,19 +614,23 @@ class Connection(object):
593
614
  _strategy_debug_log(f"No cached strategy, will try strategies in order: {strategies}")
594
615
  last_error = None
595
616
  for strategy in strategies:
596
- _strategy_debug_log(f"Attempting authentication with strategy: {strategy} (no session yet)")
617
+ _strategy_debug_log(f"Attempting authentication with strategy: {strategy} (no session yet)", self._trace_id)
597
618
  try:
598
619
  authenticate_response = self._client.authenticate(
599
620
  authenticate_request,
600
- metadata=_get_grpc_header(cluster=self.cluster_name, strategy=strategy)
621
+ metadata=_get_grpc_header(cluster=self.cluster_name, strategy=strategy,
622
+ session_id=None, request_type="authenticate", trace_id=self._trace_id)
601
623
  )
602
624
  self._session_id = authenticate_response.sessionId
603
625
  if self._session_id:
604
626
  # Success! Cache this strategy
605
- _strategy_debug_log(f"Authentication successful with strategy: {strategy}, session: {self._session_id}")
606
627
  _set_active_strategy(strategy)
607
628
  # Track which strategy was used for this session
608
629
  self._session_strategy = strategy
630
+ # Generate new trace ID for this authenticated session
631
+ old_trace_id = self._trace_id
632
+ self._trace_id = _generate_trace_id()
633
+ _strategy_debug_log(f"Authentication successful with strategy: {strategy}, session: {self._session_id}, new trace: {self._trace_id} (was: {old_trace_id})", self._trace_id)
609
634
 
610
635
  # Check for new strategy in authenticate response
611
636
  if hasattr(authenticate_response, 'new_strategy') and authenticate_response.new_strategy:
@@ -694,6 +719,7 @@ class Connection(object):
694
719
  This method ensures that the gRPC channel is properly closed and the session ID is reset to None.
695
720
  """
696
721
  old_session = self._session_id
722
+ old_trace_id = self._trace_id
697
723
  if self._channel is not None:
698
724
  self._channel.close()
699
725
  self._channel = None
@@ -704,7 +730,10 @@ class Connection(object):
704
730
  if self._debug:
705
731
  _debug_connections.discard(id(self))
706
732
  session_info = f", session was: {old_session}" if old_session else ""
707
- _strategy_debug_log(f"Debug mode disabled for connection {id(self)}{session_info}")
733
+ _strategy_debug_log(f"Debug mode disabled for connection {id(self)}{session_info}, trace: {old_trace_id}", old_trace_id)
734
+
735
+ # Reset trace ID to None after connection close
736
+ self._trace_id = None
708
737
 
709
738
  def check_connection(self):
710
739
  """
@@ -767,7 +796,8 @@ class Connection(object):
767
796
  )
768
797
  clear_response = self._client.clear(
769
798
  clear_request,
770
- metadata=_get_grpc_header(engine_ip=engine_ip, cluster=self.cluster_name, strategy=_get_active_strategy())
799
+ metadata=_get_grpc_header(engine_ip=engine_ip, cluster=self.cluster_name, strategy=_get_active_strategy(),
800
+ session_id=self.connection.get_session_id, request_type="clear", trace_id=self.connection._trace_id)
771
801
  )
772
802
 
773
803
  # Check for new strategy in clear response
@@ -798,7 +828,8 @@ class Connection(object):
798
828
  )
799
829
  cancel_response = self._client.cancelQuery(
800
830
  cancel_query_request,
801
- metadata=_get_grpc_header(engine_ip=engine_ip, cluster=self.cluster_name, strategy=_get_active_strategy())
831
+ metadata=_get_grpc_header(engine_ip=engine_ip, cluster=self.cluster_name, strategy=_get_active_strategy(),
832
+ session_id=self._session_id, request_type="query_cancel", trace_id=self._trace_id)
802
833
  )
803
834
 
804
835
  # Check for new strategy in cancel response
@@ -822,7 +853,8 @@ class Connection(object):
822
853
  )
823
854
  dry_run_response = self._client.dryRun(
824
855
  dry_run_request,
825
- metadata=_get_grpc_header(cluster=self.cluster_name, strategy=_get_active_strategy())
856
+ metadata=_get_grpc_header(cluster=self.cluster_name, strategy=_get_active_strategy(),
857
+ session_id=self.get_session_id, request_type="dry_run", trace_id=self._trace_id)
826
858
  )
827
859
  return dry_run_response.dryrunValue
828
860
 
@@ -844,7 +876,8 @@ class Connection(object):
844
876
  )
845
877
  get_table_response = self._client.getTablesV2(
846
878
  get_table_request,
847
- metadata=_get_grpc_header(cluster=self.cluster_name, strategy=_get_active_strategy())
879
+ metadata=_get_grpc_header(cluster=self.cluster_name, strategy=_get_active_strategy(),
880
+ session_id=self.get_session_id, request_type="get_tables", trace_id=self._trace_id)
848
881
  )
849
882
 
850
883
  # Check for new strategy in get tables response
@@ -872,7 +905,8 @@ class Connection(object):
872
905
  )
873
906
  get_columns_response = self._client.getColumnsV2(
874
907
  get_columns_request,
875
- metadata=_get_grpc_header(cluster=self.cluster_name, strategy=_get_active_strategy())
908
+ metadata=_get_grpc_header(cluster=self.cluster_name, strategy=_get_active_strategy(),
909
+ session_id=self.get_session_id, request_type="get_columns", trace_id=self._trace_id)
876
910
  )
877
911
 
878
912
  # Check for new strategy in get columns response
@@ -896,7 +930,8 @@ class Connection(object):
896
930
  )
897
931
  get_schema_response = self._client.getSchemaNamesV2(
898
932
  get_schema_request,
899
- metadata=_get_grpc_header(cluster=self.cluster_name, strategy=_get_active_strategy())
933
+ metadata=_get_grpc_header(cluster=self.cluster_name, strategy=_get_active_strategy(),
934
+ session_id=self.get_session_id, request_type="get_schema", trace_id=self._trace_id)
900
935
  )
901
936
 
902
937
  # Check for new strategy in get schema names response
@@ -983,10 +1018,12 @@ class Cursor(DBAPICursor):
983
1018
  """Reset state about the previous query in preparation for running another query"""
984
1019
  pass
985
1020
 
986
- @property
987
- def metadata(self):
1021
+ def _get_metadata(self, request_type="query_operation"):
988
1022
  """
989
- Get the gRPC metadata for the current query.
1023
+ Get the gRPC metadata for the current query with specific request type.
1024
+
1025
+ Args:
1026
+ request_type (str): The type of request being made
990
1027
 
991
1028
  Returns:
992
1029
  list: A list of tuples containing gRPC metadata.
@@ -999,7 +1036,18 @@ class Cursor(DBAPICursor):
999
1036
  strategy = self.connection._session_strategy
1000
1037
  else:
1001
1038
  strategy = _get_active_strategy()
1002
- return _get_grpc_header(engine_ip=self._engine_ip, cluster=self.connection.cluster_name, strategy=strategy)
1039
+ return _get_grpc_header(engine_ip=self._engine_ip, cluster=self.connection.cluster_name, strategy=strategy,
1040
+ session_id=self.connection.get_session_id, request_type=request_type, trace_id=self.connection._trace_id)
1041
+
1042
+ @property
1043
+ def metadata(self):
1044
+ """
1045
+ Get the gRPC metadata for the current query.
1046
+
1047
+ Returns:
1048
+ list: A list of tuples containing gRPC metadata.
1049
+ """
1050
+ return self._get_metadata("query_operation")
1003
1051
 
1004
1052
  @property
1005
1053
  def arraysize(self):
@@ -1141,7 +1189,7 @@ class Cursor(DBAPICursor):
1141
1189
  )
1142
1190
  # Get fresh client after session access (may have been invalidated)
1143
1191
  client = self.connection.client
1144
- clear_response = client.clearOrCancelQuery(clear_request, metadata=self.metadata)
1192
+ clear_response = client.clearOrCancelQuery(clear_request, metadata=self._get_metadata("clear_or_cancel"))
1145
1193
 
1146
1194
  # Check for new strategy in clear response
1147
1195
  if hasattr(clear_response, 'new_strategy') and clear_response.new_strategy:
@@ -1199,7 +1247,7 @@ class Cursor(DBAPICursor):
1199
1247
  queryId=query_id,
1200
1248
  engineIP=self._engine_ip
1201
1249
  )
1202
- status_response = self.connection.client.status(status_request, metadata=self.metadata)
1250
+ status_response = self.connection.client.status(status_request, metadata=self._get_metadata("status"))
1203
1251
 
1204
1252
  # Check for new strategy in status response
1205
1253
  if hasattr(status_response, 'new_strategy') and status_response.new_strategy:
@@ -1240,7 +1288,7 @@ class Cursor(DBAPICursor):
1240
1288
  client = self.connection.client
1241
1289
  prepare_statement_response = client.prepareStatement(
1242
1290
  prepare_statement_request,
1243
- metadata=self.metadata
1291
+ metadata=self._get_metadata("prepare_statement")
1244
1292
  )
1245
1293
 
1246
1294
  self._query_id = prepare_statement_response.queryId
@@ -1266,7 +1314,7 @@ class Cursor(DBAPICursor):
1266
1314
  client = self.connection.client
1267
1315
  execute_response = client.executeStatement(
1268
1316
  execute_statement_request,
1269
- metadata=self.metadata
1317
+ metadata=self._get_metadata("execute_statement")
1270
1318
  )
1271
1319
 
1272
1320
  # Check for new strategy in execute response
@@ -1285,7 +1333,7 @@ class Cursor(DBAPICursor):
1285
1333
  client = self.connection.client
1286
1334
  prepare_statement_response = client.prepareStatementV2(
1287
1335
  prepare_statement_request,
1288
- metadata=self.metadata,
1336
+ metadata=self._get_metadata("prepare_statement_v2"),
1289
1337
  timeout=self.connection.grpc_prepare_timeout
1290
1338
  )
1291
1339
 
@@ -1313,7 +1361,7 @@ class Cursor(DBAPICursor):
1313
1361
  client = self.connection.client
1314
1362
  execute_response = client.executeStatementV2(
1315
1363
  execute_statement_request,
1316
- metadata=self.metadata
1364
+ metadata=self._get_metadata("execute_statement_v2")
1317
1365
  )
1318
1366
 
1319
1367
  # Check for new strategy in execute response
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: e6data-python-connector
3
- Version: 2.3.10rc3
3
+ Version: 2.3.10rc5
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.3.10,rc3-blue.svg)
41
+ ![version](https://img.shields.io/badge/version-2.3.10,rc5-blue.svg)
42
42
 
43
43
  ## Introduction
44
44
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  import setuptools
14
14
 
15
- VERSION = (2, 3, 10, 'rc3')
15
+ VERSION = (2, 3, 10, 'rc5')
16
16
 
17
17
 
18
18
  def get_long_desc():