pyexasol 2.3.0__tar.gz → 2.3.2__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 (41) hide show
  1. {pyexasol-2.3.0 → pyexasol-2.3.2}/PKG-INFO +3 -2
  2. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/connection.py +48 -10
  3. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/http_transport.py +30 -6
  4. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyproject.toml +4 -8
  5. {pyexasol-2.3.0 → pyexasol-2.3.2}/LICENSE.txt +0 -0
  6. {pyexasol-2.3.0 → pyexasol-2.3.2}/README.md +0 -0
  7. {pyexasol-2.3.0 → pyexasol-2.3.2}/exasol/driver/__init__.py +0 -0
  8. {pyexasol-2.3.0 → pyexasol-2.3.2}/exasol/driver/websocket/__init__.py +0 -0
  9. {pyexasol-2.3.0 → pyexasol-2.3.2}/exasol/driver/websocket/_connection.py +0 -0
  10. {pyexasol-2.3.0 → pyexasol-2.3.2}/exasol/driver/websocket/_cursor.py +0 -0
  11. {pyexasol-2.3.0 → pyexasol-2.3.2}/exasol/driver/websocket/_errors.py +0 -0
  12. {pyexasol-2.3.0 → pyexasol-2.3.2}/exasol/driver/websocket/_protocols.py +0 -0
  13. {pyexasol-2.3.0 → pyexasol-2.3.2}/exasol/driver/websocket/_types.py +0 -0
  14. {pyexasol-2.3.0 → pyexasol-2.3.2}/exasol/driver/websocket/dbapi2.py +0 -0
  15. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/__init__.py +0 -0
  16. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/__main__.py +0 -0
  17. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/_metadata.py +0 -0
  18. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/_sql_splitter.py +0 -0
  19. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/callback.py +0 -0
  20. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/constant.py +0 -0
  21. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/db2/__init__.py +0 -0
  22. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/exceptions.py +0 -0
  23. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/ext.py +0 -0
  24. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/formatter.py +0 -0
  25. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/local_config.py +0 -0
  26. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/logger.py +0 -0
  27. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/mapper.py +0 -0
  28. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/meta.py +0 -0
  29. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/py.typed +0 -0
  30. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/script_output.py +0 -0
  31. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/statement.py +0 -0
  32. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol/warnings.py +0 -0
  33. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol_utils/__init__.py +0 -0
  34. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol_utils/bench.py +0 -0
  35. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol_utils/bench_sql/prepare.sql +0 -0
  36. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol_utils/bench_sql/t1_group_by.sql +0 -0
  37. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol_utils/bench_sql/t2_local_join.sql +0 -0
  38. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol_utils/bench_sql/t3_global_join.sql +0 -0
  39. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol_utils/bench_sql/t4_sort.sql +0 -0
  40. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol_utils/docker_util.py +0 -0
  41. {pyexasol-2.3.0 → pyexasol-2.3.2}/pyexasol_utils/script_output.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyexasol
3
- Version: 2.3.0
3
+ Version: 2.3.2
4
4
  Summary: Exasol python driver with extra features
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE.txt
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
18
19
  Classifier: Intended Audience :: Developers
19
20
  Classifier: Topic :: Database
20
21
  Provides-Extra: all
@@ -44,7 +45,7 @@ Requires-Dist: python-rapidjson (>=1.21.0,<2.0.0) ; extra == "rapidjson"
44
45
  Requires-Dist: ujson (>=5.10.0,<6.0.0) ; extra == "all"
45
46
  Requires-Dist: ujson (>=5.10.0,<6.0.0) ; extra == "ujson"
46
47
  Requires-Dist: websocket-client (>=1.0.1,<2)
47
- Project-URL: Changelog, https://github.com/exasol/pyexasol/blob/master/CHANGELOG.md
48
+ Project-URL: Changelog, https://exasol.github.io/pyexasol/master/changes/changelog.html
48
49
  Project-URL: Documentation, https://github.com/exasol/pyexasol/
49
50
  Project-URL: Homepage, https://www.exasol.com/
50
51
  Project-URL: Issues, https://github.com/exasol/pyexasol/issues
@@ -906,14 +906,22 @@ class ExaConnection:
906
906
  False if ("format" in export_params) else self.options["compression"]
907
907
  )
908
908
 
909
+ # Set when either worker finishes, successfully or exceptionally. It
910
+ # wakes the coordinator but does not terminate the other worker.
911
+ worker_finished_event = threading.Event()
909
912
  http_thread = ExaHttpThread(
910
- self.ws_ipaddr, # type: ignore
911
- self.ws_port, # type: ignore
912
- compression,
913
- self.options["encryption"],
913
+ ipaddr=self.ws_ipaddr, # type: ignore
914
+ port=self.ws_port, # type: ignore
915
+ compression=compression,
916
+ encryption=self.options["encryption"],
917
+ worker_finished_event=worker_finished_event,
914
918
  )
915
919
  sql_thread = ExaSQLExportThread(
916
- self, compression, query_or_table, export_params
920
+ connection=self,
921
+ compression=compression,
922
+ query_or_table=query_or_table,
923
+ export_params=export_params,
924
+ worker_finished_event=worker_finished_event,
917
925
  )
918
926
 
919
927
  try:
@@ -925,6 +933,14 @@ class ExaConnection:
925
933
  with http_thread.read_pipe as pipe:
926
934
  result = callback(pipe, dst, **callback_params)
927
935
 
936
+ # Either worker may finish first. Wake up as soon as one reports
937
+ # completion so errors can be observed without waiting on the
938
+ # other connection indefinitely.
939
+ worker_finished_event.wait()
940
+
941
+ # Join HTTP first: an SQL failure terminates HTTP, while HTTP does
942
+ # not terminate SQL directly. The order prevents waiting on HTTP
943
+ # before the SQL worker has had a chance to stop it.
928
944
  http_thread.join_with_exc()
929
945
  sql_thread.join_with_exc()
930
946
 
@@ -987,13 +1003,23 @@ class ExaConnection:
987
1003
  False if ("format" in import_params) else self.options["compression"]
988
1004
  )
989
1005
 
1006
+ # Set when either worker finishes, successfully or exceptionally. It
1007
+ # wakes the coordinator but does not terminate the other worker.
1008
+ worker_finished_event = threading.Event()
990
1009
  http_thread = ExaHttpThread(
991
- self.ws_ipaddr, # type: ignore
992
- self.ws_port, # type: ignore
993
- compression,
994
- self.options["encryption"],
1010
+ ipaddr=self.ws_ipaddr, # type: ignore
1011
+ port=self.ws_port, # type: ignore
1012
+ compression=compression,
1013
+ encryption=self.options["encryption"],
1014
+ worker_finished_event=worker_finished_event,
1015
+ )
1016
+ sql_thread = ExaSQLImportThread(
1017
+ connection=self,
1018
+ compression=compression,
1019
+ table=table,
1020
+ import_params=import_params,
1021
+ worker_finished_event=worker_finished_event,
995
1022
  )
996
- sql_thread = ExaSQLImportThread(self, compression, table, import_params)
997
1023
 
998
1024
  try:
999
1025
  http_thread.start()
@@ -1004,6 +1030,18 @@ class ExaConnection:
1004
1030
  with http_thread.write_pipe as pipe:
1005
1031
  result = callback(pipe, src, **callback_params)
1006
1032
 
1033
+ # The callback has finished writing. Allow the HTTP handler to send the
1034
+ # final chunk and finish the request.
1035
+ http_thread.server.can_finish_get.set()
1036
+
1037
+ # Either worker may finish first. Wake up as soon as one reports
1038
+ # completion so errors can be observed without waiting on the
1039
+ # other connection indefinitely.
1040
+ worker_finished_event.wait()
1041
+
1042
+ # Join HTTP first: an SQL failure terminates HTTP, while HTTP does
1043
+ # not terminate SQL directly. The order prevents waiting on HTTP
1044
+ # before the SQL worker has had a chance to stop it.
1007
1045
  http_thread.join_with_exc()
1008
1046
  sql_thread.join_with_exc()
1009
1047
 
@@ -298,7 +298,12 @@ class ExaSQLThread(threading.Thread):
298
298
  Thread class which re-throws any Exception to parent thread
299
299
  """
300
300
 
301
- def __init__(self, connection: ExaConnection, compression: bool):
301
+ def __init__(
302
+ self,
303
+ connection: ExaConnection,
304
+ compression: bool,
305
+ worker_finished_event: threading.Event | None = None,
306
+ ):
302
307
  self.connection = connection
303
308
  self.compression = compression
304
309
 
@@ -306,6 +311,7 @@ class ExaSQLThread(threading.Thread):
306
311
  self.http_thread = None
307
312
  self.exa_address_list: list[str] = []
308
313
  self.exc = None
314
+ self.worker_finished_event = worker_finished_event
309
315
 
310
316
  super().__init__()
311
317
 
@@ -325,13 +331,15 @@ class ExaSQLThread(threading.Thread):
325
331
  # In case of SQL error stop HTTP server, close pipes and interrupt I/O in callback function
326
332
  if self.http_thread:
327
333
  self.http_thread.terminate()
334
+ finally:
335
+ if self.worker_finished_event:
336
+ self.worker_finished_event.set()
328
337
 
329
338
  def run_sql(self):
330
339
  pass
331
340
 
332
341
  def join_with_exc(self, *args):
333
342
  super().join(*args)
334
-
335
343
  if self.exc:
336
344
  raise self.exc
337
345
 
@@ -348,8 +356,11 @@ class ExaSQLExportThread(ExaSQLThread):
348
356
  compression: bool,
349
357
  query_or_table,
350
358
  export_params: dict,
359
+ worker_finished_event: threading.Event | None = None,
351
360
  ):
352
- super().__init__(connection, compression)
361
+ super().__init__(
362
+ connection, compression, worker_finished_event=worker_finished_event
363
+ )
353
364
 
354
365
  self.query_or_table = query_or_table
355
366
  self.params = export_params
@@ -380,7 +391,7 @@ class ExaSQLExportThread(ExaSQLThread):
380
391
 
381
392
  class ExaSQLImportThread(ExaSQLThread):
382
393
  """
383
- Build and run EXPORT query into separate thread
394
+ Build and run IMPORT query into separate thread
384
395
  Main thread is busy parsing results in callbacks
385
396
  """
386
397
 
@@ -390,8 +401,11 @@ class ExaSQLImportThread(ExaSQLThread):
390
401
  compression: bool,
391
402
  table: str,
392
403
  import_params: dict,
404
+ worker_finished_event: threading.Event | None = None,
393
405
  ):
394
- super().__init__(connection, compression)
406
+ super().__init__(
407
+ connection, compression, worker_finished_event=worker_finished_event
408
+ )
395
409
 
396
410
  self.table = table
397
411
  self.params = import_params
@@ -414,7 +428,14 @@ class ExaHttpThread(threading.Thread):
414
428
  - https://pythonforthelab.com/blog/differences-between-multiprocessing-windows-and-linux/
415
429
  """
416
430
 
417
- def __init__(self, ipaddr: str, port: int, compression: bool, encryption: bool):
431
+ def __init__(
432
+ self,
433
+ ipaddr: str,
434
+ port: int,
435
+ compression: bool,
436
+ encryption: bool,
437
+ worker_finished_event: threading.Event | None = None,
438
+ ):
418
439
  self.server = ExaTCPServer(
419
440
  (ipaddr, port),
420
441
  ExaHttpRequestHandler,
@@ -424,6 +445,7 @@ class ExaHttpThread(threading.Thread):
424
445
 
425
446
  self.read_pipe = self.server.read_pipe
426
447
  self.write_pipe = self.server.write_pipe
448
+ self.worker_finished_event = worker_finished_event
427
449
 
428
450
  self.exc = None
429
451
 
@@ -446,6 +468,8 @@ class ExaHttpThread(threading.Thread):
446
468
  self.exc = e
447
469
  finally:
448
470
  self.server.server_close()
471
+ if self.worker_finished_event is not None:
472
+ self.worker_finished_event.set()
449
473
 
450
474
  def join(self, timeout=None):
451
475
  self.server.can_finish_get.set()
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pyexasol"
3
- version = "2.3.0"
3
+ version = "2.3.2"
4
4
  description = "Exasol python driver with extra features"
5
5
  authors = [
6
6
  { name = "Vitaly Markov", email = "wild.desu@gmail.com" },
@@ -26,6 +26,7 @@ classifiers = [
26
26
  "Programming Language :: Python :: 3.11",
27
27
  "Programming Language :: Python :: 3.12",
28
28
  "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: 3.14",
29
30
  "Intended Audience :: Developers",
30
31
  "Topic :: Database",
31
32
  ]
@@ -73,7 +74,7 @@ Homepage = "https://www.exasol.com/"
73
74
  Documentation = "https://github.com/exasol/pyexasol/"
74
75
  Source = "https://github.com/exasol/pyexasol"
75
76
  Issues = "https://github.com/exasol/pyexasol/issues"
76
- Changelog = "https://github.com/exasol/pyexasol/blob/master/CHANGELOG.md"
77
+ Changelog = "https://exasol.github.io/pyexasol/master/changes/changelog.html"
77
78
 
78
79
  [dependency-groups]
79
80
  dev = [
@@ -82,7 +83,7 @@ dev = [
82
83
  "docutils>=0.21.2,<0.22",
83
84
  "exasol-integration-test-docker-environment>=6.4.1,<7",
84
85
  "faker>=24.14.1,<25",
85
- "exasol-toolbox>=10.3.0,<11",
86
+ "exasol-toolbox>=10.4.0,<11",
86
87
  "types-ujson>=5.10.0.20250326,<6",
87
88
  "pytest-repeat>=0.9.4, <1.0.0",
88
89
  "pandas-stubs>=2.3.3.251219,<3",
@@ -123,14 +124,9 @@ max-module-lines = 800
123
124
  [[tool.mypy.overrides]]
124
125
  module = [
125
126
  # no stubs available as of 2025
126
- "orjson.*",
127
- "rapidjson.*",
128
127
  "pyarrow.*",
129
128
  "pyodbc.*",
130
129
  "turbodbc.*",
131
- # code we are not yet type checking
132
- "examples.*",
133
- "test.*"
134
130
  ]
135
131
  ignore_errors = true
136
132
  ignore_missing_imports = true
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