code: def serialize_payload(self) -> str:
      if self._exc_status == SqlJsonExecutionStatus.HAS_RESULTS:
          return json.dumps(
              apply_display_max_row_configuration_if_require(
                  self.payload, self._max_row_in_display_configuration
              ),
              default=utils.pessimistic_json_iso_dttm_ser,
              ignore_nan=True,
              encoding=None,
          )
  
      return json.dumps(
          {"query": self.payload},
          default=utils.json_int_dttm_ser,
          ignore_nan=True,
      )
  
file_path: superset/superset/sqllab/execution_context_convertor.py
imports: from __future__ import annotations
  import logging
  from typing import Any, TYPE_CHECKING
  import simplejson
  import superset.utils.core
  from superset.sqllab.command_status import SqlJsonExecutionStatus
  from superset.sqllab.utils import apply_display_max_row_configuration_if_require
label_desc: Use image node_id 3 for calling the ExecutionContextConvertor obj's underlying member method code with example usage: obj.serialize_payload() and returns: json, json