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/08/29 07:54:06 UTC

[GitHub] [airflow] phanikumv commented on a diff in pull request #26028: Allow setting TaskGroup tooltip via function docstring

phanikumv commented on code in PR #26028:
URL: https://github.com/apache/airflow/pull/26028#discussion_r957002808


##########
tests/decorators/test_task_group.py:
##########
@@ -50,3 +51,38 @@ def simple_tg():
         },
         'add_suffix_on_collision': True,
     }
+
+
+def test_toolip_derived_from_function_docstring():
+    """Test that the tooltip for TaskGroup is the decorated-function's docsring."""

Review Comment:
   ```suggestion
       """Test that the tooltip for TaskGroup is the decorated-function's docstring."""
   ```



##########
tests/decorators/test_task_group.py:
##########
@@ -50,3 +51,38 @@ def simple_tg():
         },
         'add_suffix_on_collision': True,
     }
+
+
+def test_toolip_derived_from_function_docstring():
+    """Test that the tooltip for TaskGroup is the decorated-function's docsring."""
+
+    @dag(start_date=pendulum.datetime(2022, 1, 1))
+    def pipeline():
+        @task_group()
+        def tg():
+            """Function docstring."""
+
+        tg()
+
+    _ = pipeline()
+
+    assert _.task_group_dict["tg"].tooltip == "Function docstring."
+
+
+def test_toolip_not_overriden_by_function_docstring():
+    """
+    Test that the tooltip for TaskGroup is the explicitly set value even if the decorated function has a
+    docsring.

Review Comment:
   ```suggestion
       docstring.
   ```



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