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.
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/PKG-INFO +1 -1
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/PKG-INFO +1 -1
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/data_requests_service.py +18 -8
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/models/data_request_response.py +4 -4
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/test_data_requests.py +10 -8
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/.github/workflows/ci.yaml +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/.github/workflows/release.yaml +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/.gitignore +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/.pre-commit-config.yaml +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/CONTRIBUTING.md +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/LICENSE +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/README.md +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/pyproject.toml +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/setup.cfg +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/SOURCES.txt +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/dependency_links.txt +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/requires.txt +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/top_level.txt +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/authentication/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/authentication/auth_service.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/authentication/models/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/base_service.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/facade.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/model/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/model/base_response_model.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/w_client.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/walacor_service.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/models/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/models/data_requests_request.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/models/models.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/file_request_service.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/models/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/models/file_request_request.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/models/file_request_response.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/models/models.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/py.typed +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/models/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/models/models.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/models/schema_request.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/models/schema_response.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/schema_service.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/utils/__init__ +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/utils/enums.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/utils/exceptions.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/utils/global_exception_handler.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/utils/logger.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/__init__.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/test_client.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/test_facade.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/test_file_request.py +0 -0
- {walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/tests/test_schema.py +0 -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
|
-
|
|
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 =
|
|
266
|
+
pageNumber: int = 0,
|
|
266
267
|
pageSize: int = 0,
|
|
267
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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=
|
|
533
|
+
"query/get?pageNo=0&pageSize=0&fromSummary=true",
|
|
534
534
|
headers={"ETId": "22", "SV": "1"},
|
|
535
|
-
json=
|
|
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
|
|
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
|
|
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/
|
|
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
|
|
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
|
|
|
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
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/requires.txt
RENAMED
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_python_sdk.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/authentication/__init__.py
RENAMED
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/authentication/auth_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/model/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/base/walacor_service.py
RENAMED
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/data_requests/models/models.py
RENAMED
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/file_request/models/models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/models/__init__.py
RENAMED
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/models/models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{walacor_python_sdk-0.1.6 → walacor_python_sdk-0.1.8}/src/walacor_sdk/schema/schema_service.py
RENAMED
|
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
|