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/10/17 05:46:29 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #26872: Update old style typing

uranusjr commented on code in PR #26872:
URL: https://github.com/apache/airflow/pull/26872#discussion_r996612005


##########
airflow/dag_processing/processor.py:
##########
@@ -326,20 +320,14 @@ def done(self) -> bool:
 
     @property
     def result(self) -> tuple[int, int] | None:
-        """
-        :return: result of running DagFileProcessor.process_file()
-        :rtype: tuple[int, int] or None
-        """
+        """:return: result of running DagFileProcessor.process_file()"""
         if not self.done:
             raise AirflowException("Tried to get the result before it's done!")
         return self._result
 
     @property
     def start_time(self) -> datetime.datetime:
-        """
-        :return: when this started to process the file
-        :rtype: datetime
-        """
+        """:return: when this started to process the file"""

Review Comment:
   ```suggestion
           """Time when this started to process the file."""
   ```



##########
airflow/kubernetes/pod_launcher_deprecated.py:
##########
@@ -141,7 +141,7 @@ def monitor_pod(self, pod: V1Pod, get_logs: bool) -> tuple[State, str | None]:
 
         :param pod: pod spec that will be monitored
         :param get_logs: whether to read the logs locally
-        :return:  Tuple[State, Optional[str]]
+        :return:  tuple[State, str | None]

Review Comment:
   ```suggestion
   ```



##########
airflow/dag_processing/processor.py:
##########
@@ -259,10 +258,7 @@ def _kill_process(self) -> None:
 
     @property
     def pid(self) -> int:
-        """
-        :return: the PID of the process launched to process the given file
-        :rtype: int
-        """
+        """:return: the PID of the process launched to process the given file"""

Review Comment:
   ```suggestion
           """PID of the process launched to process the given file."""
   ```



##########
airflow/dag_processing/processor.py:
##########
@@ -326,20 +320,14 @@ def done(self) -> bool:
 
     @property
     def result(self) -> tuple[int, int] | None:
-        """
-        :return: result of running DagFileProcessor.process_file()
-        :rtype: tuple[int, int] or None
-        """
+        """:return: result of running DagFileProcessor.process_file()"""

Review Comment:
   ```suggestion
           """Result of running ``DagFileProcessor.process_file()``."""
   ```



##########
airflow/migrations/utils.py:
##########
@@ -20,7 +20,7 @@
 from contextlib import contextmanager
 
 
-def get_mssql_table_constraints(conn, table_name):
+def get_mssql_table_constraints(conn, table_name) -> defaultdict(list):

Review Comment:
   ```suggestion
   def get_mssql_table_constraints(conn, table_name) -> dict[str, dict[str, list[str]]]:
   ```
   
   I don’t think you can _call_ `defaultdict` here… (same for other calls below). We can do `defaultdict[...]` but it’s not necessary, a `dict` is good enough.



-- 
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