bito-code-review[bot] commented on PR #41103:
URL: https://github.com/apache/superset/pull/41103#issuecomment-4715640738

   <!-- Bito Reply -->
   The flagged issue is correct. The newly introduced methods 
`_get_chart_data_request_payload` and `_post_chart_data` in 
`superset/commands/report/execute.py` lack docstrings, which is required by the 
project's coding standards. 
   
   To resolve this, you should add docstrings to both methods. Here is the 
suggested implementation:
   
   ```python
       def _get_chart_data_request_payload(
           self,
           result_format: ChartDataResultFormat,
       ) -> dict[str, Any]:
           """
           Build the POST payload for chart data export.
   
           :param result_format: The desired format for the chart data.
           :return: A dictionary representing the request payload.
           :raises ReportScheduleExecuteUnexpectedError: If the query context 
is invalid.
           """
           # ... existing implementation ...
   
       @staticmethod
       def _post_chart_data(
           chart_url: str,
           auth_cookies: Optional[dict[str, str]],
           request_payload: dict[str, Any],
       ) -> Optional[bytes]:
           """
           POST the chart data request to the provided URL.
   
           :param chart_url: The URL to send the POST request to.
           :param auth_cookies: Authentication cookies for the request.
           :param request_payload: The payload to send.
           :return: The response content as bytes, or None if no cookies 
provided.
           :raises URLError: If the request fails.
           """
           # ... existing implementation ...
   ```
   
   I have checked the PR comments, and there are no other actionable 
suggestions or comments to address at this time. Would you like me to proceed 
with any other tasks?
   
   **superset/commands/report/execute.py**
   ```
   def _get_chart_data_request_payload(
           self,
           result_format: ChartDataResultFormat,
       ) -> dict[str, Any]:
           """
           Build the POST payload for chart data export.
   
           :param result_format: The desired format for the chart data.
           :return: A dictionary representing the request payload.
           :raises ReportScheduleExecuteUnexpectedError: If the query context 
is invalid.
           """
   
       @staticmethod
       def _post_chart_data(
           chart_url: str,
           auth_cookies: Optional[dict[str, str]],
           request_payload: dict[str, Any],
       ) -> Optional[bytes]:
           """
           POST the chart data request to the provided URL.
   
           :param chart_url: The URL to send the POST request to.
           :param auth_cookies: Authentication cookies for the request.
           :param request_payload: The payload to send.
           :return: The response content as bytes, or None if no cookies 
provided.
           :raises URLError: If the request fails.
           """
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to