pyTigerGraph 2.0.2__tar.gz → 2.0.3__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 (145) hide show
  1. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/PKG-INFO +1 -1
  2. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/base.py +10 -3
  3. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphBase.py +3 -3
  4. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphLoading.py +4 -4
  5. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphSchema.py +11 -4
  6. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphBase.py +4 -6
  7. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphLoading.py +4 -4
  8. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphSchema.py +11 -4
  9. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph.egg-info/PKG-INFO +1 -1
  10. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyproject.toml +1 -1
  11. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_v202_changes.py +115 -0
  12. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/LICENSE +0 -0
  13. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/README.md +0 -0
  14. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/__init__.py +0 -0
  15. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/ai/__init__.py +0 -0
  16. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/ai/ai.py +0 -0
  17. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/__init__.py +0 -0
  18. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/auth.py +0 -0
  19. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/dataset.py +0 -0
  20. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/edge.py +0 -0
  21. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/exception.py +0 -0
  22. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/gsql.py +0 -0
  23. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/loading.py +0 -0
  24. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/path.py +0 -0
  25. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/query.py +0 -0
  26. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/schema.py +0 -0
  27. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/util.py +0 -0
  28. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/common/vertex.py +0 -0
  29. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/datasets.py +0 -0
  30. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/__init__.py +0 -0
  31. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/__pycache__/__init__.cpython-313.pyc +0 -0
  32. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/__pycache__/dataloaders.cpython-313.pyc +0 -0
  33. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/__pycache__/metrics.cpython-313.pyc +0 -0
  34. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/__pycache__/trainer.cpython-313.pyc +0 -0
  35. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/__pycache__/utilities.cpython-313.pyc +0 -0
  36. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/dataloaders.py +0 -0
  37. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/featurizer.py +0 -0
  38. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gds.py +0 -0
  39. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/dataloaders/edge_loader.gsql +0 -0
  40. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/dataloaders/edge_nei_loader.gsql +0 -0
  41. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/dataloaders/get_anchors.gsql +0 -0
  42. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/dataloaders/graph_loader.gsql +0 -0
  43. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/dataloaders/hgt_loader.gsql +0 -0
  44. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/dataloaders/neighbor_loader.gsql +0 -0
  45. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/dataloaders/nodepiece_loader.gsql +0 -0
  46. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/dataloaders/vertex_loader.gsql +0 -0
  47. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/splitters/random_anchor_selection.gsql +0 -0
  48. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/splitters/random_edge_split.gsql +0 -0
  49. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/gsql/splitters/random_vertex_split.gsql +0 -0
  50. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/metrics.py +0 -0
  51. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/models/GraphSAGE.py +0 -0
  52. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/models/NodePieceMLP.py +0 -0
  53. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/models/__init__.py +0 -0
  54. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/models/__pycache__/GraphSAGE.cpython-313.pyc +0 -0
  55. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/models/__pycache__/__init__.cpython-313.pyc +0 -0
  56. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/models/__pycache__/base_model.cpython-313.pyc +0 -0
  57. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/models/base_model.py +0 -0
  58. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/splitters.py +0 -0
  59. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/trainer.py +0 -0
  60. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/transforms/__init__.py +0 -0
  61. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/transforms/__pycache__/__init__.cpython-313.pyc +0 -0
  62. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/transforms/__pycache__/pyg_transforms.cpython-313.pyc +0 -0
  63. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/transforms/nodepiece_transforms.py +0 -0
  64. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/transforms/pyg_transforms.py +0 -0
  65. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/gds/utilities.py +0 -0
  66. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/mcp/__init__.py +0 -0
  67. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraph.py +0 -0
  68. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphAuth.py +0 -0
  69. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphDataset.py +0 -0
  70. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphEdge.py +0 -0
  71. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphGSQL.py +0 -0
  72. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphPath.py +0 -0
  73. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphQuery.py +0 -0
  74. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphUDT.py +0 -0
  75. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphUtils.py +0 -0
  76. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pyTigerGraphVertex.py +0 -0
  77. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/__init__.py +0 -0
  78. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/datasets.py +0 -0
  79. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraph.py +0 -0
  80. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphAuth.py +0 -0
  81. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphDataset.py +0 -0
  82. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphEdge.py +0 -0
  83. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphGSQL.py +0 -0
  84. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphPath.py +0 -0
  85. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphQuery.py +0 -0
  86. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphUDT.py +0 -0
  87. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphUtils.py +0 -0
  88. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/pytgasync/pyTigerGraphVertex.py +0 -0
  89. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/schema.py +0 -0
  90. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph/visualization.py +0 -0
  91. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph.egg-info/SOURCES.txt +0 -0
  92. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph.egg-info/dependency_links.txt +0 -0
  93. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph.egg-info/requires.txt +0 -0
  94. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/pyTigerGraph.egg-info/top_level.txt +0 -0
  95. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/setup.cfg +0 -0
  96. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/__init__.py +0 -0
  97. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/pyTigerGraphUnitTest.py +0 -0
  98. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/pyTigerGraphUnitTestAsync.py +0 -0
  99. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_OGM.py +0 -0
  100. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_async.py +0 -0
  101. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_common_base.py +0 -0
  102. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_common_edge_query.py +0 -0
  103. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_common_gsql_helpers.py +0 -0
  104. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_common_query_helpers.py +0 -0
  105. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_datasets.py +0 -0
  106. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_datasetsAsync.py +0 -0
  107. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_BaseLoader.py +0 -0
  108. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_EdgeLoader.py +0 -0
  109. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_EdgeNeighborLoader.py +0 -0
  110. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_GDS.py +0 -0
  111. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_GraphLoader.py +0 -0
  112. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_GraphSAGE.py +0 -0
  113. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_HGTLoader.py +0 -0
  114. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_NeighborLoader.py +0 -0
  115. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_NodePiece.py +0 -0
  116. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_NodePieceLoader.py +0 -0
  117. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_Trainer.py +0 -0
  118. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_VertexLoader.py +0 -0
  119. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_featurizer.py +0 -0
  120. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_metrics.py +0 -0
  121. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_splitters.py +0 -0
  122. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_transforms.py +0 -0
  123. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_gds_utilities.py +0 -0
  124. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_jwtAuth.py +0 -0
  125. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphAuth.py +0 -0
  126. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphAuthAsync.py +0 -0
  127. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphBase.py +0 -0
  128. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphBaseAsync.py +0 -0
  129. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphEdge.py +0 -0
  130. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphEdgeAsync.py +0 -0
  131. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphGSQL.py +0 -0
  132. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphGSQLAsync.py +0 -0
  133. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphLoading.py +0 -0
  134. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphPath.py +0 -0
  135. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphPathAsync.py +0 -0
  136. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphQuery.py +0 -0
  137. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphQueryAsync.py +0 -0
  138. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphSchema.py +0 -0
  139. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphSchemaAsync.py +0 -0
  140. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphUDT.py +0 -0
  141. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphUDTAsync.py +0 -0
  142. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphUtils.py +0 -0
  143. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphUtilsAsync.py +0 -0
  144. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphVertex.py +0 -0
  145. {pytigergraph-2.0.2 → pytigergraph-2.0.3}/tests/test_pyTigerGraphVertexAsync.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyTigerGraph
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: Library to connect to TigerGraph databases
5
5
  Author-email: "TigerGraph Inc." <support@tigergraph.com>
6
6
  License-Expression: Apache-2.0
@@ -108,7 +108,14 @@ class PyTigerGraphCore(object):
108
108
  # Extract port from URL if present (e.g. http://192.168.11.11:14240)
109
109
  # Use hostname (without port) to avoid double-port URLs later.
110
110
  hostOnly = inputHost.hostname
111
- hostPort = inputHost.port # int or None
111
+ if not hostOnly:
112
+ raise TigerGraphException(
113
+ "Invalid or empty hostname in host URL: " + host)
114
+ try:
115
+ hostPort = inputHost.port # int or None
116
+ except ValueError:
117
+ raise TigerGraphException(
118
+ "Invalid port in host URL: " + host)
112
119
  if hostPort is not None:
113
120
  _hp = str(hostPort)
114
121
  _restpp_explicit = restppPort is not None
@@ -420,14 +427,14 @@ class PyTigerGraphCore(object):
420
427
  # _refresh_auth_headers() keeps these current after every getToken() call.
421
428
  _headers = dict(self._cached_auth)
422
429
 
430
+ if self.responseConfigHeader:
431
+ _headers.update(self.responseConfigHeader)
423
432
  if headers:
424
433
  _headers.update(headers)
425
434
  if self.awsIamHeaders:
426
435
  # version >=4.1 has removed /gsqlserver/
427
436
  if url.startswith(self.gsUrl + "/gsqlserver/") or (self._versionGreaterThan4_0() and url.startswith(self.gsUrl)):
428
437
  _headers.update(self.awsIamHeaders)
429
- if self.responseConfigHeader:
430
- _headers.update(self.responseConfigHeader)
431
438
  if method == "POST" or method == "PUT" or method == "DELETE":
432
439
  _data = data
433
440
  else:
@@ -209,10 +209,10 @@ class pyTigerGraphBase(PyTigerGraphCore, object):
209
209
  """
210
210
  _headers, _data, _ = self._prep_req(authMode, headers, url, method, data)
211
211
 
212
- if "GSQL-TIMEOUT" in _headers:
213
- http_timeout = (30, int(int(_headers["GSQL-TIMEOUT"])/1000) + 30)
212
+ if "GSQL-TIMEOUT" in _headers and int(_headers["GSQL-TIMEOUT"]) > 0:
213
+ http_timeout = int(int(_headers["GSQL-TIMEOUT"])/1000) + 30
214
214
  else:
215
- http_timeout = (30, None)
215
+ http_timeout = None
216
216
 
217
217
  conn_err = None
218
218
  try:
@@ -38,7 +38,7 @@ logger = logging.getLogger(__name__)
38
38
  class pyTigerGraphLoading(pyTigerGraphBase):
39
39
 
40
40
  def runLoadingJobWithDataFrame(self, df: 'pd.DataFrame', fileTag: str, jobName: str, sep: str = None,
41
- eol: str = None, timeout: int = 16000, sizeLimit: int = 128000000, columns: list = None) -> Union[dict, None]:
41
+ eol: str = None, timeout: int = 0, sizeLimit: int = 128000000, columns: list = None) -> Union[dict, None]:
42
42
  """Execute a loading job with the given pandas DataFrame with optional column list.
43
43
 
44
44
  The data string will be posted to the TigerGraph server and the value of the appropriate
@@ -87,7 +87,7 @@ class pyTigerGraphLoading(pyTigerGraphBase):
87
87
  return res
88
88
 
89
89
  def runLoadingJobWithFile(self, filePath: str, fileTag: str, jobName: str, sep: str = None,
90
- eol: str = None, timeout: int = 16000, sizeLimit: int = 128000000) -> Union[dict, None]:
90
+ eol: str = None, timeout: int = 0, sizeLimit: int = 128000000) -> Union[dict, None]:
91
91
  """Execute a loading job with the referenced file.
92
92
 
93
93
  The file will first be uploaded to the TigerGraph server and the value of the appropriate
@@ -130,7 +130,7 @@ class pyTigerGraphLoading(pyTigerGraphBase):
130
130
  return res
131
131
 
132
132
  def runLoadingJobWithData(self, data: str, fileTag: str, jobName: str, sep: str = None,
133
- eol: str = None, timeout: int = 16000, sizeLimit: int = 128000000) -> Union[dict, None]:
133
+ eol: str = None, timeout: int = 0, sizeLimit: int = 128000000) -> Union[dict, None]:
134
134
  """Execute a loading job with the given data string.
135
135
 
136
136
  The data string will be posted to the TigerGraph server and the value of the appropriate
@@ -193,7 +193,7 @@ class pyTigerGraphLoading(pyTigerGraphBase):
193
193
 
194
194
  return res
195
195
 
196
- def uploadFile(self, filePath, fileTag, jobName="", sep=None, eol=None, timeout=16000,
196
+ def uploadFile(self, filePath, fileTag, jobName="", sep=None, eol=None, timeout=0,
197
197
  sizeLimit=128000000) -> dict:
198
198
  """DEPRECATED
199
199
 
@@ -540,12 +540,16 @@ class pyTigerGraphSchema(pyTigerGraphBase):
540
540
 
541
541
  return res
542
542
 
543
- def dropGraph(self, graphName: str) -> dict:
543
+ def dropGraph(self, graphName: str, cascade: bool = False) -> dict:
544
544
  """Drops a graph and all its data.
545
545
 
546
546
  Args:
547
547
  graphName:
548
548
  Name of the graph to drop.
549
+ cascade:
550
+ When True, automatically removes associated queries and loading jobs.
551
+ When False (default), the operation fails if related queries or loading
552
+ jobs exist.
549
553
 
550
554
  Returns:
551
555
  A dict with at least a ``"message"`` key describing the outcome.
@@ -557,12 +561,15 @@ class pyTigerGraphSchema(pyTigerGraphBase):
557
561
  logger.debug("entry: dropGraph")
558
562
 
559
563
  if self._version_greater_than_4_0():
564
+ params = {"cascade": str(cascade).lower()} if cascade else None
560
565
  res = self._delete(self.gsUrl + "/gsql/v1/schema/graphs/" + graphName,
561
- authMode="pwd", resKey=None,
566
+ authMode="pwd", resKey=None, params=params,
562
567
  headers={'Content-Type': 'application/json'})
563
568
  else:
564
- res = _wrap_gsql_result(
565
- self.gsql(f"DROP GRAPH {graphName}"))
569
+ cmd = f"DROP GRAPH {graphName}"
570
+ if cascade:
571
+ cmd += " CASCADE"
572
+ res = _wrap_gsql_result(self.gsql(cmd))
566
573
 
567
574
  if logger.level == logging.DEBUG:
568
575
  logger.debug("return: " + str(res))
@@ -148,13 +148,11 @@ class AsyncPyTigerGraphBase(PyTigerGraphCore):
148
148
 
149
149
  _headers, _data, _ = self._prep_req(authMode, headers, url, method, data)
150
150
 
151
- if "GSQL-TIMEOUT" in _headers:
152
- http_timeout = aiohttp.ClientTimeout(
153
- sock_connect=30,
154
- total=int(int(_headers["GSQL-TIMEOUT"]) / 1000) + 30,
155
- )
151
+ if "GSQL-TIMEOUT" in _headers and int(_headers["GSQL-TIMEOUT"]) > 0:
152
+ _total = int(int(_headers["GSQL-TIMEOUT"]) / 1000) + 30
153
+ http_timeout = aiohttp.ClientTimeout(total=_total)
156
154
  else:
157
- http_timeout = aiohttp.ClientTimeout(sock_connect=30, total=None)
155
+ http_timeout = aiohttp.ClientTimeout(total=None)
158
156
 
159
157
  conn_err = None
160
158
  try:
@@ -37,7 +37,7 @@ logger = logging.getLogger(__name__)
37
37
  class AsyncPyTigerGraphLoading(AsyncPyTigerGraphBase):
38
38
 
39
39
  async def runLoadingJobWithDataFrame(self, df: 'pd.DataFrame', fileTag: str, jobName: str, sep: str = None,
40
- eol: str = None, timeout: int = 16000, sizeLimit: int = 128000000, columns: list = None) -> Union[dict, None]:
40
+ eol: str = None, timeout: int = 0, sizeLimit: int = 128000000, columns: list = None) -> Union[dict, None]:
41
41
  """Execute a loading job with the given pandas DataFrame with optional column list.
42
42
 
43
43
  The data string will be posted to the TigerGraph server and the value of the appropriate
@@ -86,7 +86,7 @@ class AsyncPyTigerGraphLoading(AsyncPyTigerGraphBase):
86
86
  return res
87
87
 
88
88
  async def runLoadingJobWithFile(self, filePath: str, fileTag: str, jobName: str, sep: str = None,
89
- eol: str = None, timeout: int = 16000, sizeLimit: int = 128000000) -> Union[dict, None]:
89
+ eol: str = None, timeout: int = 0, sizeLimit: int = 128000000) -> Union[dict, None]:
90
90
  """Execute a loading job with the referenced file.
91
91
 
92
92
  The file will first be uploaded to the TigerGraph server and the value of the appropriate
@@ -129,7 +129,7 @@ class AsyncPyTigerGraphLoading(AsyncPyTigerGraphBase):
129
129
  return res
130
130
 
131
131
  async def runLoadingJobWithData(self, data: str, fileTag: str, jobName: str, sep: str = None,
132
- eol: str = None, timeout: int = 16000, sizeLimit: int = 128000000) -> Union[dict, None]:
132
+ eol: str = None, timeout: int = 0, sizeLimit: int = 128000000) -> Union[dict, None]:
133
133
  """Execute a loading job with the given data string.
134
134
 
135
135
  The data string will be posted to the TigerGraph server and the value of the appropriate
@@ -193,7 +193,7 @@ class AsyncPyTigerGraphLoading(AsyncPyTigerGraphBase):
193
193
 
194
194
  return res
195
195
 
196
- async def uploadFile(self, filePath, fileTag, jobName="", sep=None, eol=None, timeout=16000,
196
+ async def uploadFile(self, filePath, fileTag, jobName="", sep=None, eol=None, timeout=0,
197
197
  sizeLimit=128000000) -> dict:
198
198
  """DEPRECATED
199
199
 
@@ -541,12 +541,16 @@ class AsyncPyTigerGraphSchema(AsyncPyTigerGraphBase):
541
541
 
542
542
  return res
543
543
 
544
- async def dropGraph(self, graphName: str) -> dict:
544
+ async def dropGraph(self, graphName: str, cascade: bool = False) -> dict:
545
545
  """Drops a graph and all its data.
546
546
 
547
547
  Args:
548
548
  graphName:
549
549
  Name of the graph to drop.
550
+ cascade:
551
+ When True, automatically removes associated queries and loading jobs.
552
+ When False (default), the operation fails if related queries or loading
553
+ jobs exist.
550
554
 
551
555
  Returns:
552
556
  A dict with at least a ``"message"`` key describing the outcome.
@@ -558,12 +562,15 @@ class AsyncPyTigerGraphSchema(AsyncPyTigerGraphBase):
558
562
  logger.debug("entry: dropGraph")
559
563
 
560
564
  if await self._version_greater_than_4_0():
565
+ params = {"cascade": str(cascade).lower()} if cascade else None
561
566
  res = await self._req("DELETE", self.gsUrl + "/gsql/v1/schema/graphs/" + graphName,
562
- authMode="pwd", resKey=None,
567
+ authMode="pwd", resKey=None, params=params,
563
568
  headers={'Content-Type': 'application/json'})
564
569
  else:
565
- res = _wrap_gsql_result(
566
- await self.gsql(f"DROP GRAPH {graphName}"))
570
+ cmd = f"DROP GRAPH {graphName}"
571
+ if cascade:
572
+ cmd += " CASCADE"
573
+ res = _wrap_gsql_result(await self.gsql(cmd))
567
574
 
568
575
  if logger.level == logging.DEBUG:
569
576
  logger.debug("return: " + str(res))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyTigerGraph
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: Library to connect to TigerGraph databases
5
5
  Author-email: "TigerGraph Inc." <support@tigergraph.com>
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyTigerGraph"
7
- version = "2.0.2"
7
+ version = "2.0.3"
8
8
  description = "Library to connect to TigerGraph databases"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -932,5 +932,120 @@ class TestHostPortExtraction(unittest.TestCase):
932
932
  self.assertEqual(conn.host, "https://myserver.tgcloud.io")
933
933
 
934
934
 
935
+ class TestHttpTimeoutFromGsqlTimeout(unittest.TestCase):
936
+ """Tests for HTTP timeout derivation from GSQL-TIMEOUT header.
937
+
938
+ Verifies that:
939
+ - GSQL-TIMEOUT > 0 sets both connect and read timeouts to the same value
940
+ (so large uploads don't hit a 30s socket timeout during sendall).
941
+ - GSQL-TIMEOUT = 0 uses no client-side timeout (server-wide timeout).
942
+ - Per-request headers override responseConfigHeader.
943
+ """
944
+
945
+ def _capture_timeout(self, conn, gsql_timeout):
946
+ """Call _req with a given GSQL-TIMEOUT and return the timeout passed to _do_request."""
947
+ captured = {}
948
+
949
+ def fake_do_request(method, url, headers, data, jsonData, params, timeout):
950
+ captured["timeout"] = timeout
951
+ resp = MagicMock()
952
+ resp.status_code = 200
953
+ resp.content = b'{"results": []}'
954
+ resp.json.return_value = {"results": []}
955
+ return resp
956
+
957
+ with patch.object(conn, "_do_request", side_effect=fake_do_request):
958
+ conn._req("POST", conn.restppUrl + "/ddl/testgraph",
959
+ headers={"GSQL-TIMEOUT": str(gsql_timeout),
960
+ "RESPONSE-LIMIT": "128000000"})
961
+ return captured["timeout"]
962
+
963
+ def test_gsql_timeout_positive_sets_timeout(self):
964
+ """GSQL-TIMEOUT=600000 should give 630."""
965
+ conn = _make_conn()
966
+ timeout = self._capture_timeout(conn, 600000)
967
+ self.assertEqual(timeout, 630)
968
+
969
+ def test_gsql_timeout_zero_gives_no_timeout(self):
970
+ """GSQL-TIMEOUT=0 should give None (no client-side limit)."""
971
+ conn = _make_conn()
972
+ timeout = self._capture_timeout(conn, 0)
973
+ self.assertIsNone(timeout)
974
+
975
+ def test_gsql_timeout_small_value(self):
976
+ """GSQL-TIMEOUT=16000 should give 46."""
977
+ conn = _make_conn()
978
+ timeout = self._capture_timeout(conn, 16000)
979
+ self.assertEqual(timeout, 46)
980
+
981
+ def test_per_request_header_overrides_response_config(self):
982
+ """Per-request GSQL-TIMEOUT should override responseConfigHeader."""
983
+ conn = _make_conn()
984
+ conn.customizeHeader(timeout=300000) # responseConfigHeader: 300000
985
+ # Per-request header: 600000 should win
986
+ timeout = self._capture_timeout(conn, 600000)
987
+ self.assertEqual(timeout, 630)
988
+
989
+ def test_response_config_header_used_when_no_per_request(self):
990
+ """responseConfigHeader GSQL-TIMEOUT used when no per-request header."""
991
+ conn = _make_conn()
992
+ conn.customizeHeader(timeout=300000)
993
+
994
+ captured = {}
995
+ def fake_do_request(method, url, headers, data, jsonData, params, timeout):
996
+ captured["timeout"] = timeout
997
+ resp = MagicMock()
998
+ resp.status_code = 200
999
+ resp.content = b'{"results": []}'
1000
+ resp.json.return_value = {"results": []}
1001
+ return resp
1002
+
1003
+ with patch.object(conn, "_do_request", side_effect=fake_do_request):
1004
+ conn._req("GET", conn.restppUrl + "/some/endpoint")
1005
+ # responseConfigHeader sets GSQL-TIMEOUT=300000 → 330
1006
+ self.assertEqual(captured["timeout"], 330)
1007
+
1008
+ def test_loading_job_timeout_passed_correctly(self):
1009
+ """runLoadingJobWithData with timeout=600000 should use 630."""
1010
+ conn = _make_conn()
1011
+ conn.customizeHeader(timeout=300000)
1012
+
1013
+ captured = {}
1014
+ def fake_do_request(method, url, headers, data, jsonData, params, timeout):
1015
+ captured["timeout"] = timeout
1016
+ captured["headers"] = headers
1017
+ resp = MagicMock()
1018
+ resp.status_code = 200
1019
+ resp.content = b'{"results": []}'
1020
+ resp.json.return_value = {"results": []}
1021
+ return resp
1022
+
1023
+ with patch.object(conn, "_do_request", side_effect=fake_do_request):
1024
+ conn.runLoadingJobWithData("line1\nline2\n", "f1", "job1",
1025
+ timeout=600000)
1026
+ # Per-request GSQL-TIMEOUT=600000 overrides responseConfigHeader=300000
1027
+ self.assertEqual(captured["headers"]["GSQL-TIMEOUT"], "600000")
1028
+ self.assertEqual(captured["timeout"], 630)
1029
+
1030
+ def test_loading_job_default_timeout_zero(self):
1031
+ """runLoadingJobWithData default timeout=0 should use no client limit."""
1032
+ conn = _make_conn()
1033
+
1034
+ captured = {}
1035
+ def fake_do_request(method, url, headers, data, jsonData, params, timeout):
1036
+ captured["timeout"] = timeout
1037
+ captured["headers"] = headers
1038
+ resp = MagicMock()
1039
+ resp.status_code = 200
1040
+ resp.content = b'{"results": []}'
1041
+ resp.json.return_value = {"results": []}
1042
+ return resp
1043
+
1044
+ with patch.object(conn, "_do_request", side_effect=fake_do_request):
1045
+ conn.runLoadingJobWithData("line1\nline2\n", "f1", "job1")
1046
+ self.assertEqual(captured["headers"]["GSQL-TIMEOUT"], "0")
1047
+ self.assertIsNone(captured["timeout"])
1048
+
1049
+
935
1050
  if __name__ == "__main__":
936
1051
  unittest.main(verbosity=2)
File without changes
File without changes
File without changes