class_docstr: Encapsulation of all communication with and data structures sent to StreamAlert Kinesis
class_docstr_tok: ["Encapsulation","of","all","communication","with","and","data","structures","sent","to","StreamAlert","Kinesis"]
docstr: Send Kinesis record to StreamAlert upon query failure
  
  In this case, there is no result.
  
  Args:
      query_pack (QueryPack): The QueryPack that failed to complete.
docstr_tok: ["Send","Kinesis","record","to","StreamAlert","upon","query","failure","In","this","case",",","there","is","no","result",".","Args",":","query_pack","(","QueryPack",")",":","The","QueryPack","that","failed","to","complete","."]
code: def send_error_results(self, query_pack):
      """Send Kinesis record to StreamAlert upon query failure
  
      In this case, there is no result.
  
      Args:
          query_pack (QueryPack): The QueryPack that failed to complete.
      """
      query = (
          query_pack.query_pack_configuration
      )  # type: QueryPackConfiguration
  
      query_execution_id = query_pack.query_execution.query_execution_id
      console_link = (
          "https://us-east-1.console.aws.amazon.com/athena/home"
          "?region=us-east-1#query/history/{}"
      ).format(query_execution_id)
      streamquery_result = {
          "streamquery_schema_version": self.STREAMQUERY_SCHEMA_VERSION,
          "execution": {
              "name": query.name,
              "description": query.description,
              "query": query_pack.query_execution.query,
              "query_parameters": query_pack.query_parameters,
              "data_scanned_in_bytes": query_pack.query_execution.data_scanned_in_bytes,
              "execution_time_ms": query_pack.query_execution.engine_execution_time_in_millis,
              "tags": query.tags,
              "query_execution_id": query_execution_id,
              "console_link": console_link,
              "error": {
                  "description": query_pack.query_execution.status_description
              },
          },
          "data": {
              "headers": [],
              "rows": [],
              "count": 0,
          },
      }
  
      self._logger.info(
          "Sending StreamQuery record to kinesis stream: {}".format(
              self._kinesis_stream
          )
      )
      self._logger.debug(
          json.dumps(
              streamquery_result, indent=2, separators=(", ", ": ")
          )
      )
  
      response = self._client.put_records(
          Records=[
              {
                  "Data": json.dumps(streamquery_result),
                  "PartitionKey": "partitionKeyFoo",
              },
          ],
          StreamName=self._kinesis_stream,
      )
      self._logger.debug(response)
  
      if response["ResponseMetadata"]["HTTPStatusCode"] == 200:
          self._logger.info("  Success.")
      else:
          self._logger.info("  ERROR!")
  
      self._logger.info("Done.")
  
imports: import json
label_desc: Use image node_id 3 for calling the KinesisClient obj's underlying member method code with example usage: obj.send_error_results(query_pack) without return types