Add page stats to response payload.

This commit is contained in:
Jim Myers 2023-05-25 19:44:47 -04:00
parent 10ade8a1c8
commit 13b5dae883
3 changed files with 7 additions and 1 deletions

View File

@ -1 +1 @@
2.0.4
2.0.5

View File

@ -21,6 +21,7 @@ class QueryResultSetBuilder(object):
self.errorData = query_run.errorData
self.dataSourceQueryId = query_run.dataSourceQueryId
self.dataSourceSessionId = query_run.dataSourceSessionId
self.page = query_result.page
self.path = query_run.path
self.run_stats = self.compute_run_stats(query_run)
@ -35,6 +36,7 @@ class QueryResultSetBuilder(object):
rows=self.rows,
run_stats=self.run_stats,
records=self.records,
page=self.page,
error=None,
)

View File

@ -2,6 +2,7 @@ from typing import Any, List, Union
from pydantic import BaseModel, Field
from .compass.core.page_stats import PageStats
from .query_run_stats import QueryRunStats
@ -25,4 +26,7 @@ class QueryResultSet(BaseModel):
records: Union[List[Any], None] = Field(
None, description="The results of the query transformed as an array of objects"
)
page: Union[PageStats, None] = Field(
None, description="Summary of page stats for this query result set"
)
error: Any