You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/28 15:53:05 UTC

[GitHub] [airflow] stamixthereal commented on a diff in pull request #28619: Fix code readability, add docstrings to json_client

stamixthereal commented on code in PR #28619:
URL: https://github.com/apache/airflow/pull/28619#discussion_r1058438631


##########
airflow/api/client/json_client.py:
##########
@@ -24,9 +24,25 @@
 
 
 class Client(api_client.Client):
-    """Json API client implementation."""
+    """Json API client implementation.
 
-    def _request(self, url, method="GET", json=None):
+    This client is used to interact with a Json API server and perform various actions
+    such as triggering DAG runs,deleting DAGs, interacting with pools, and getting lineage information.
+
+    :param _api_base_url: The base URL for the Json API server.
+    :param _session: A session object to use for making HTTP requests.
+    """
+
+    def _request(self, url: str, json=None, method: str = "GET"):
+        """Make a request to the Json API server.
+
+        :param url: The URL to send the request to.
+        :param method: The HTTP method to use (e.g. "GET", "POST", "DELETE").
+        :param json: A dictionary containing JSON data to send in the request body.
+        :return: A dictionary containing the JSON response from the server.
+        :rtype: dict

Review Comment:
   Absolutely agree with you, @ephraimbuddy, but in that case I receive following message from pre-commit run-mypy
   hook. Should we leave this method this without typehint?
    
   ![Screenshot from 2022-12-28 18-49-43](https://user-images.githubusercontent.com/94890848/209837921-b2e560c0-8dc3-4fdc-bfa2-792551e199bc.png)
   



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org