You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ferruzzi (via GitHub)" <gi...@apache.org> on 2023/07/13 05:29:10 UTC

[GitHub] [airflow] ferruzzi opened a new pull request, #32575: D205 Support - Models

ferruzzi opened a new pull request, #32575:
URL: https://github.com/apache/airflow/pull/32575

   Part of https://github.com/apache/airflow/issues/10742
   
   D205 asserts that all docstrings must have a one-line summary ending in a period.  If there is more than one sentence then there must be a blank line before the rest of the docstring.  Meeting these requirements could be as simple as adding a newline, or might require some rephrasing.
   
   There are almost a thousand violations in the repo so we're going to have to take this in bites.
   
   ### PLEASE NOTE
   
   There should be zero changes to any functional logic or type hinting in this PR, only changes to docstrings and whitespace.  If you see otherwise, please call it out.
   
   ### Included in this chunk
   
   All files in the `airflow/models` module.
   
   ### To test
   
   If you comment out [this line](https://github.com/apache/airflow/blob/main/pyproject.toml#L68) and run pre-commit in main you will get 250 errors.  After these changes, "only" 147 remain and no files in the`airflow/models` folder should be on the list.  After uncommenting that line and rerunning pre-commits, there should be zero regressions. 


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


[GitHub] [airflow] ferruzzi commented on pull request #32575: D205 Support - Models

Posted by "ferruzzi (via GitHub)" <gi...@apache.org>.
ferruzzi commented on PR #32575:
URL: https://github.com/apache/airflow/pull/32575#issuecomment-1638547027

   @uranusjr - Could you have another look when you get time?


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


[GitHub] [airflow] uranusjr commented on a diff in pull request #32575: D205 Support - Models

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #32575:
URL: https://github.com/apache/airflow/pull/32575#discussion_r1267329313


##########
airflow/models/dag.py:
##########
@@ -3316,10 +3315,10 @@ def __repr__(self):
 
 
 class DagOwnerAttributes(Base):
-    """Table defining different owner attributes.
+    """
+    Table defining different owner attributes.
 
-    For example, a link for an owner that will be passed as a hyperlink to the
-    "DAGs" view.
+    For example, a link for an owner that will be passed as a hyperlink to the "DAGs" view.
     """

Review Comment:
   What does this change? The previous string looks fine to me



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


[GitHub] [airflow] ferruzzi commented on a diff in pull request #32575: D205 Support - Models

Posted by "ferruzzi (via GitHub)" <gi...@apache.org>.
ferruzzi commented on code in PR #32575:
URL: https://github.com/apache/airflow/pull/32575#discussion_r1267335361


##########
airflow/models/dag.py:
##########
@@ -3316,10 +3315,10 @@ def __repr__(self):
 
 
 class DagOwnerAttributes(Base):
-    """Table defining different owner attributes.
+    """
+    Table defining different owner attributes.
 
-    For example, a link for an owner that will be passed as a hyperlink to the
-    "DAGs" view.
+    For example, a link for an owner that will be passed as a hyperlink to the "DAGs" view.
     """

Review Comment:
   without the awkward git diff display, this:
   
   ```
   """Table defining different owner attributes.
   
   For example, a link for an owner that will be passed as a hyperlink to the
   "DAGs" view.
   """
   ```
   
   changes to this:
   
   ```
   """
   Table defining different owner attributes.
   
   For example, a link for an owner that will be passed as a hyperlink to the "DAGs" view.
   """
   ```



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


[GitHub] [airflow] ferruzzi commented on a diff in pull request #32575: D205 Support - Models

Posted by "ferruzzi (via GitHub)" <gi...@apache.org>.
ferruzzi commented on code in PR #32575:
URL: https://github.com/apache/airflow/pull/32575#discussion_r1267332168


##########
airflow/models/dag.py:
##########
@@ -3316,10 +3315,10 @@ def __repr__(self):
 
 
 class DagOwnerAttributes(Base):
-    """Table defining different owner attributes.
+    """
+    Table defining different owner attributes.
 
-    For example, a link for an owner that will be passed as a hyperlink to the
-    "DAGs" view.
+    For example, a link for an owner that will be passed as a hyperlink to the "DAGs" view.
     """

Review Comment:
   `ruff` didn't like the summary sentence being one the same line as the triple-quotes (old line 3319 becomes new line 3318L:3319) an I removed the line break on old line 3321 (old lines 3321:3322 becomes new line 3321) since the string fits on one line fine..



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


[GitHub] [airflow] uranusjr commented on a diff in pull request #32575: D205 Support - Models

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on code in PR #32575:
URL: https://github.com/apache/airflow/pull/32575#discussion_r1262003109


##########
airflow/models/baseoperator.py:
##########
@@ -354,8 +354,7 @@ class BaseOperatorMeta(abc.ABCMeta):
     @classmethod
     def _apply_defaults(cls, func: T) -> T:
         """
-        Function decorator that Looks for an argument named "default_args", and
-        fills the unspecified arguments from it.
+        Look for an argument named "default_args", and fills the unspecified arguments from it.

Review Comment:
   ```suggestion
           Look for an argument named "default_args", and fill the unspecified arguments from it.
   ```



##########
airflow/models/baseoperator.py:
##########
@@ -1127,19 +1128,17 @@ def has_dag(self):
     """
 
     def prepare_for_execution(self) -> BaseOperator:
-        """
-        Lock task for execution to disable custom action in __setattr__ and
-        returns a copy of the task.
-        """
+        """Lock task for execution to disable custom action in __setattr__ and returns a copy of the task."""

Review Comment:
   ```suggestion
           """Lock task for execution to disable custom action in ``__setattr__`` and returns a copy of the task."""
   ```



##########
airflow/models/baseoperator.py:
##########
@@ -462,10 +461,12 @@ def __new__(cls, name, bases, namespace, **kwargs):
 @functools.total_ordering
 class BaseOperator(AbstractOperator, metaclass=BaseOperatorMeta):
     """
-    Abstract base class for all operators. Since operators create objects that
-    become nodes in the dag, BaseOperator contains many recursive methods for
-    dag crawling behavior. To derive this class, you are expected to override
-    the constructor as well as the 'execute' method.
+    Abstract base class for all operators.
+
+    Since operators create objects that become nodes in the dag, BaseOperator
+    contains many recursive methods for dag crawling behavior. To derive this
+    class, you are expected to override the constructor as well as the 'execute'
+    method.

Review Comment:
   ```suggestion
       Since operators create objects that become nodes in the DAG, BaseOperator
       contains many recursive methods for DAG crawling behavior. To derive from
       this class, you are expected to override the constructor and the 'execute'
       method.
   ```



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


[GitHub] [airflow] potiuk merged pull request #32575: D205 Support - Models

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #32575:
URL: https://github.com/apache/airflow/pull/32575


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