walacor-python-sdk 0.1.6__tar.gz → 0.1.8__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 (56) hide show
  1. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/PKG-INFO +1 -1
  2. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/PKG-INFO +1 -1
  3. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/data_requests_service.py +18 -8
  4. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/models/data_request_response.py +4 -4
  5. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/test_data_requests.py +10 -8
  6. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/.github/workflows/ci.yaml +0 -0
  7. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/.github/workflows/release.yaml +0 -0
  8. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/.gitignore +0 -0
  9. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/.pre-commit-config.yaml +0 -0
  10. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/CONTRIBUTING.md +0 -0
  11. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/LICENSE +0 -0
  12. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/README.md +0 -0
  13. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/pyproject.toml +0 -0
  14. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/setup.cfg +0 -0
  15. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/SOURCES.txt +0 -0
  16. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/dependency_links.txt +0 -0
  17. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/requires.txt +0 -0
  18. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/top_level.txt +0 -0
  19. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/__init__.py +0 -0
  20. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/authentication/__init__.py +0 -0
  21. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/authentication/auth_service.py +0 -0
  22. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/authentication/models/__init__.py +0 -0
  23. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/__init__.py +0 -0
  24. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/base_service.py +0 -0
  25. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/facade.py +0 -0
  26. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/model/__init__.py +0 -0
  27. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/model/base_response_model.py +0 -0
  28. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/w_client.py +0 -0
  29. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/walacor_service.py +0 -0
  30. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/__init__.py +0 -0
  31. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/models/__init__.py +0 -0
  32. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/models/data_requests_request.py +0 -0
  33. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/models/models.py +0 -0
  34. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/__init__.py +0 -0
  35. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/file_request_service.py +0 -0
  36. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/models/__init__.py +0 -0
  37. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/models/file_request_request.py +0 -0
  38. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/models/file_request_response.py +0 -0
  39. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/models/models.py +0 -0
  40. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/py.typed +0 -0
  41. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/__init__.py +0 -0
  42. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/models/__init__.py +0 -0
  43. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/models/models.py +0 -0
  44. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/models/schema_request.py +0 -0
  45. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/models/schema_response.py +0 -0
  46. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/schema_service.py +0 -0
  47. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/utils/__init__ +0 -0
  48. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/utils/enums.py +0 -0
  49. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/utils/exceptions.py +0 -0
  50. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/utils/global_exception_handler.py +0 -0
  51. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/utils/logger.py +0 -0
  52. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/__init__.py +0 -0
  53. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/test_client.py +0 -0
  54. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/test_facade.py +0 -0
  55. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/test_file_request.py +0 -0
  56. {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/test_schema.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: walacor_python_sdk
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Python SDK for Walacor
5
5
  Author-email: Garo Kechichian <garo.keshish@gmail.com>
6
6
  License: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: walacor_python_sdk
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: Python SDK for Walacor
5
5
  Author-email: Garo Kechichian <garo.keshish@gmail.com>
6
6
  License: Apache-2.0
@@ -230,7 +230,7 @@ class DataRequestsService(BaseService):
230
230
  # ------------------------------------------------------------------ READ – complex/aggregate
231
231
 
232
232
  def post_complex_query(
233
- self, ETId: int, pipeline: list[dict[str, Any]]
233
+ self, ETId: int, pipeline: list[dict[str, Any]], fromSummary: bool = True
234
234
  ) -> ComplexQueryRecords | None:
235
235
  """Run an arbitrary Mongo‑style aggregation *pipeline* (``getcomplex``).
236
236
 
@@ -242,7 +242,8 @@ class DataRequestsService(BaseService):
242
242
  :class:`ComplexQueryRecords` or ``None`` on failure.
243
243
  """
244
244
  header = {"ETId": str(ETId)}
245
- response = self._post("query/getcomplex", headers=header, json=pipeline)
245
+ query = f"query/getcomplex?fromSummary={'true' if fromSummary else 'false'}"
246
+ response = self._post(query, headers=header, json=pipeline)
246
247
 
247
248
  if not response or not response.get("success"):
248
249
  logger.error("Failed to fetch complex query results")
@@ -260,11 +261,12 @@ class DataRequestsService(BaseService):
260
261
  def post_query_api(
261
262
  self,
262
263
  ETId: int,
263
- payload: dict[str, Any],
264
+ payload: list[dict[str, Any]] | None = None,
264
265
  schemaVersion: int = 1,
265
- pageNumber: int = 1,
266
+ pageNumber: int = 0,
266
267
  pageSize: int = 0,
267
- ) -> list[str] | None:
268
+ fromSummary: bool = True,
269
+ ) -> list[dict[str, Any]] | None:
268
270
  """Endpoint helper for the simplified *query API*.
269
271
 
270
272
  Args:
@@ -273,12 +275,13 @@ class DataRequestsService(BaseService):
273
275
  schemaVersion: `SV` header value – defaults to latest (``1``).
274
276
  pageNumber: 1‑based index of the page to retrieve.
275
277
  pageSize: Number of rows per page (``0`` = no limit).
278
+ fromSummary: Query summary table instead of full detail.
276
279
 
277
280
  Returns:
278
281
  Raw JSON *strings* returned by the platform or ``None``.
279
282
  """
280
283
  headers = {"ETId": str(ETId), "SV": str(schemaVersion)}
281
- query = f"query/get?pageNo={pageNumber}&pageSize={pageSize}"
284
+ query = f"query/get?pageNo={pageNumber}&pageSize={pageSize}&fromSummary={'true' if fromSummary else 'false'}"
282
285
  response = self._post(query, headers=headers, json=payload)
283
286
 
284
287
  if not response or not response.get("success"):
@@ -298,6 +301,7 @@ class DataRequestsService(BaseService):
298
301
  ETId: int = 10,
299
302
  schemaVersion: int = 1,
300
303
  dataVersion: int = 1,
304
+ fromSummary: bool = True,
301
305
  ) -> QueryApiAggregate | None:
302
306
  """Wrapper for *query/getComplex* when using the **aggregate** flavour.
303
307
 
@@ -306,6 +310,7 @@ class DataRequestsService(BaseService):
306
310
  ETId: Primary collection ETId – default ``10``.
307
311
  schemaVersion: `SV` header value.
308
312
  dataVersion: `DV` header value.
313
+ fromSummary: Query summary table instead of full detail.
309
314
 
310
315
  Returns:
311
316
  :class:`QueryApiAggregate` with ``Records`` and ``Total`` or ``None``.
@@ -315,7 +320,8 @@ class DataRequestsService(BaseService):
315
320
  "SV": str(schemaVersion),
316
321
  "DV": str(dataVersion),
317
322
  }
318
- response = self._post("query/getComplex", headers=headers, json=payload)
323
+ query = f"query/getcomplex?fromSummary={'true' if fromSummary else 'false'}"
324
+ response = self._post(query, headers=headers, json=payload)
319
325
 
320
326
  if not response or not response.get("success"):
321
327
  logger.error("Failed to fetch aggregate results")
@@ -334,18 +340,22 @@ class DataRequestsService(BaseService):
334
340
  self,
335
341
  pipeline: list[dict[str, Any]],
336
342
  ETId: int,
343
+ fromSummary: bool = True,
337
344
  ) -> ComplexQMLQueryRecords | None:
338
345
  """Pass‑through helper for advanced *MQL* pipelines.
339
346
 
340
347
  Args:
341
348
  pipeline: Mongo Query Language aggregate pipeline.
342
349
  ETId: Primary collection envelope‑type ID.
350
+ fromSummary: Query summary table instead of full detail.
343
351
 
344
352
  Returns:
345
353
  :class:`ComplexQMLQueryRecords` or ``None``.
346
354
  """
347
355
  header = {"ETId": str(ETId)}
348
- response = self._post("query/getcomplex", headers=header, json=pipeline)
356
+ query = f"query/getcomplex?fromSummary={'true' if fromSummary else 'false'}"
357
+
358
+ response = self._post(query, headers=header, json=pipeline)
349
359
 
350
360
  if not response or not response.get("success"):
351
361
  logger.error("Failed to fetch MQL query results")
@@ -20,17 +20,17 @@ class GetSingleRecordResponse(BaseResponse[list[dict[str, Any]]]):
20
20
  pass
21
21
 
22
22
 
23
- class GetComplexQueryResponse(BaseResponse[list[dict[str, str]]]):
23
+ class GetComplexQueryResponse(BaseResponse[list[dict[str, Any]]]):
24
24
  Total: int = Field(..., alias="total")
25
25
 
26
26
 
27
- class QueryApiResponse(BaseResponse[list[str]]):
27
+ class QueryApiResponse(BaseResponse[list[dict[str, Any]]]):
28
28
  pass
29
29
 
30
30
 
31
- class QueryApiAggregateResponse(BaseResponse[list[dict[str, str]]]):
31
+ class QueryApiAggregateResponse(BaseResponse[list[dict[str, Any]]]):
32
32
  Total: int = Field(..., alias="total")
33
33
 
34
34
 
35
- class GetComplexQMLQueryResponse(BaseResponse[list[dict[str, str]]]):
35
+ class GetComplexQMLQueryResponse(BaseResponse[list[dict[str, Any]]]):
36
36
  Total: int = Field(..., alias="total")
@@ -479,7 +479,7 @@ def test_post_complex_query_success(mock_logging, service):
479
479
  assert result.Total == 1
480
480
  assert isinstance(result.Records, list)
481
481
  service._post.assert_called_once_with(
482
- "query/getcomplex",
482
+ "query/getcomplex?fromSummary=true",
483
483
  headers={"ETId": "101"},
484
484
  json=[{"match": "criteria"}],
485
485
  )
@@ -526,13 +526,13 @@ def test_post_query_api_success(mock_logging, service):
526
526
  "walacor_sdk.data_requests.data_requests_service.QueryApiResponse",
527
527
  return_value=MagicMock(data=["row1", "row2"]),
528
528
  ):
529
- result = service.post_query_api(ETId=22, payload={"some": "query"})
529
+ result = service.post_query_api(ETId=22)
530
530
 
531
531
  assert result == ["row1", "row2"]
532
532
  service._post.assert_called_once_with(
533
- "query/get?pageNo=1&pageSize=0",
533
+ "query/get?pageNo=0&pageSize=0&fromSummary=true",
534
534
  headers={"ETId": "22", "SV": "1"},
535
- json={"some": "query"},
535
+ json=None,
536
536
  )
537
537
  mock_logging.error.assert_not_called()
538
538
 
@@ -542,7 +542,7 @@ def test_post_query_api_failure_flag(mock_logging, service):
542
542
  """Test post_query_api returns None and logs error when response is unsuccessful."""
543
543
  service._post = MagicMock(return_value={"success": False})
544
544
 
545
- result = service.post_query_api(ETId=7, payload={"bad": "query"})
545
+ result = service.post_query_api(ETId=7)
546
546
 
547
547
  assert result is None
548
548
  mock_logging.error.assert_called_once_with("Failed to fetch query results")
@@ -557,7 +557,7 @@ def test_post_query_api_validation_error(mock_logging, service):
557
557
  "walacor_sdk.data_requests.data_requests_service.QueryApiResponse",
558
558
  side_effect=ValidationError.from_exception_data("QueryApiResponse", []),
559
559
  ):
560
- result = service.post_query_api(ETId=5, payload={})
560
+ result = service.post_query_api(ETId=5)
561
561
 
562
562
  assert result is None
563
563
  mock_logging.error.assert_called()
@@ -586,7 +586,7 @@ def test_post_query_api_aggregate_success(mock_logging, service):
586
586
  assert result.Total == 3
587
587
  assert isinstance(result.Records, list)
588
588
  service._post.assert_called_once_with(
589
- "query/getComplex",
589
+ "query/getcomplex?fromSummary=true",
590
590
  headers={"ETId": "10", "SV": "1", "DV": "1"},
591
591
  json={"agg": "test"},
592
592
  )
@@ -645,7 +645,9 @@ def test_post_complex_MQL_queries_success(mock_logging, service):
645
645
  assert result.Total == 99
646
646
  assert isinstance(result.Records, list)
647
647
  service._post.assert_called_once_with(
648
- "query/getcomplex", headers={"ETId": "77"}, json=[{"stage": "match"}]
648
+ "query/getcomplex?fromSummary=true",
649
+ headers={"ETId": "77"},
650
+ json=[{"stage": "match"}],
649
651
  )
650
652
  mock_logging.error.assert_not_called()
651
653