Returns the query results with both metadata and data
(
self, cache_query_context: Optional[bool] = False, force_cached: bool = False,
)
| 297 | return df.to_dict(orient="records") |
| 298 | |
| 299 | def get_payload( |
| 300 | self, cache_query_context: Optional[bool] = False, force_cached: bool = False, |
| 301 | ) -> Dict[str, Any]: |
| 302 | """Returns the query results with both metadata and data""" |
| 303 | |
| 304 | # Get all the payloads from the QueryObjects |
| 305 | query_results = [ |
| 306 | get_query_results( |
| 307 | query_obj.result_type or self.result_type, self, query_obj, force_cached |
| 308 | ) |
| 309 | for query_obj in self.queries |
| 310 | ] |
| 311 | return_value = {"queries": query_results} |
| 312 | |
| 313 | if cache_query_context: |
| 314 | cache_key = self.cache_key() |
| 315 | set_and_log_cache( |
| 316 | cache_manager.cache, |
| 317 | cache_key, |
| 318 | {"data": self.cache_values}, |
| 319 | self.cache_timeout, |
| 320 | ) |
| 321 | return_value["cache_key"] = cache_key # type: ignore |
| 322 | |
| 323 | return return_value |
| 324 | |
| 325 | @property |
| 326 | def cache_timeout(self) -> int: |
no test coverage detected