This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 34678ace93 Fix: Add python client QueryResult model field definitions 
(#2952)
34678ace93 is described below

commit 34678ace9328d995f2128d772e6f9eaefa0f99f0
Author: airwish <[email protected]>
AuthorDate: Tue Jun 25 00:06:31 2024 +0800

    Fix: Add python client QueryResult model field definitions (#2952)
---
 .../streampipes/endpoint/api/data_lake_measure.py           | 13 +++++++++++--
 .../streampipes/model/resource/query_result.py              |  5 ++++-
 .../tests/client/test_data_lake_series.py                   |  9 +++++++++
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git 
a/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py 
b/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py
index 7751334052..5d61e50417 100644
--- a/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py
+++ b/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py
@@ -316,12 +316,21 @@ class DataLakeMeasureEndpoint(APIEndpoint):
         that the resource class of the resource container is
         the return type of the get endpoint.
         Therefore, this is only a temporary implementation and will be removed 
soon.
+
+        Returns
+        -------
+        [QueryResult][streampipes.model.resource.QueryResult]
         """
         return QueryResult
 
     @property
     def _container_cls(self) -> Type[ResourceContainer]:
-        """Defines the model container class the endpoint refers to."""
+        """Defines the model container class the endpoint refers to.
+        
+        Returns
+        -------
+        [DataLakeMeasures][streampipes.model.container.DataLakeMeasures]
+        """
         return DataLakeMeasures
 
     @property
@@ -350,7 +359,7 @@ class DataLakeMeasureEndpoint(APIEndpoint):
 
         Returns
         -------
-        measurement: DataLakeMeasures
+        measurement: QueryResult
             The specified data lake measure
 
         Examples
diff --git 
a/streampipes-client-python/streampipes/model/resource/query_result.py 
b/streampipes-client-python/streampipes/model/resource/query_result.py
index 0f05a72747..fbd613e9ce 100644
--- a/streampipes-client-python/streampipes/model/resource/query_result.py
+++ b/streampipes-client-python/streampipes/model/resource/query_result.py
@@ -16,7 +16,7 @@
 #
 
 from itertools import chain
-from typing import Any, Dict, List, Literal, Union
+from typing import Any, Dict, List, Literal, Optional, Union
 
 import pandas as pd
 from pydantic.v1 import Field, StrictInt, StrictStr
@@ -73,6 +73,9 @@ class QueryResult(Resource):
     headers: List[StrictStr]
     all_data_series: List[DataSeries]
     query_status: Literal["OK", "TOO_MUCH_DATA"] = Field(alias="spQueryStatus")
+    source_index: StrictInt
+    for_id: Optional[str]
+    last_timestamp: StrictInt
 
     def to_pandas(self) -> pd.DataFrame:
         """Returns the data lake series in representation of a Pandas 
Dataframe.
diff --git a/streampipes-client-python/tests/client/test_data_lake_series.py 
b/streampipes-client-python/tests/client/test_data_lake_series.py
index df0349a2f3..b83e71f13c 100644
--- a/streampipes-client-python/tests/client/test_data_lake_series.py
+++ b/streampipes-client-python/tests/client/test_data_lake_series.py
@@ -103,6 +103,9 @@ class TestDataLakeSeries(TestCase):
             "headers": self.headers,
             "spQueryStatus": "OK",
             "allDataSeries": [self.data_series],
+            "sourceIndex": 0,
+            "forId": None,
+            "lastTimestamp": 1717936808802,
         }
 
         result_pd = self.get_result_as_panda(http_session, query_result)
@@ -125,6 +128,9 @@ class TestDataLakeSeries(TestCase):
             "headers": self.headers,
             "spQueryStatus": "OK",
             "allDataSeries": [self.data_series, self.data_series],
+            "sourceIndex": 0,
+            "forId": None,
+            "lastTimestamp": 1717936808802,
         }
 
         result_pd = self.get_result_as_panda(http_session, query_result)
@@ -147,6 +153,9 @@ class TestDataLakeSeries(TestCase):
             "headers": ["one"],
             "spQueryStatus": "OK",
             "allDataSeries": [self.data_series],
+            "sourceIndex": 0,
+            "forId": None,
+            "lastTimestamp": 1717936808802,
         }
 
         with self.assertRaises(StreamPipesUnsupportedDataSeries):

Reply via email to