This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new a1eef777380 Add doc_md to Python and LatestOnly example DAGs (#66670)
a1eef777380 is described below

commit a1eef777380c68aea9670259217b3c37bba99a1d
Author: Kyu Park <[email protected]>
AuthorDate: Mon May 11 06:09:57 2026 +0200

    Add doc_md to Python and LatestOnly example DAGs (#66670)
    
    * Add doc_md to standard example DAGs
    
    Adds DAG-level documentation to example_latest_only and 
example_python_operator by wiring module docstrings into doc_md. This improves 
the Airflow UI Docs tab for example DAGs without changing runtime behavior.
    
    Closes: #60128
    
    * Address example DAG doc review feedback
    
    Updates the LatestOnlyOperator documentation link and adds Markdown 
headings so the rendered DAG Docs tab follows the existing example style.
---
 .../standard/example_dags/example_latest_only.py       | 14 +++++++++++++-
 .../standard/example_dags/example_python_operator.py   | 18 +++++++++++++++---
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git 
a/providers/standard/src/airflow/providers/standard/example_dags/example_latest_only.py
 
b/providers/standard/src/airflow/providers/standard/example_dags/example_latest_only.py
index 745100def2a..4484c9f7111 100644
--- 
a/providers/standard/src/airflow/providers/standard/example_dags/example_latest_only.py
+++ 
b/providers/standard/src/airflow/providers/standard/example_dags/example_latest_only.py
@@ -15,7 +15,18 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-"""Example of the LatestOnlyOperator"""
+"""### LatestOnlyOperator
+
+Example DAG demonstrating the LatestOnlyOperator.
+
+The LatestOnlyOperator skips downstream tasks for all DAG runs except the
+most recent scheduled run. This is useful when downstream work should only run
+for the latest interval, such as refreshing a dashboard or publishing a current
+snapshot.
+
+See also:
+https://airflow.apache.org/docs/apache-airflow-providers-standard/stable/operators/latest_only.html
+"""
 
 from __future__ import annotations
 
@@ -31,6 +42,7 @@ with DAG(
     start_date=datetime.datetime(2021, 1, 1),
     catchup=False,
     tags=["example2", "example3"],
+    doc_md=__doc__,
 ) as dag:
     # [START howto_operator_latest_only]
     latest_only = LatestOnlyOperator(task_id="latest_only")
diff --git 
a/providers/standard/src/airflow/providers/standard/example_dags/example_python_operator.py
 
b/providers/standard/src/airflow/providers/standard/example_dags/example_python_operator.py
index a9378938873..beccd986ff0 100644
--- 
a/providers/standard/src/airflow/providers/standard/example_dags/example_python_operator.py
+++ 
b/providers/standard/src/airflow/providers/standard/example_dags/example_python_operator.py
@@ -15,9 +15,20 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-"""
-Example DAG demonstrating the usage of the classic Python operators to execute 
Python functions natively and
-within a virtual environment.
+"""### Python operators
+
+Example DAG demonstrating classic Python operators.
+
+This DAG shows several ways to execute Python callables in Airflow:
+PythonOperator for regular Python functions, PythonVirtualenvOperator for
+functions that need an isolated virtual environment, and ExternalPythonOperator
+for running a callable with a specific Python binary.
+
+It also demonstrates passing keyword arguments, rendering templated files, and
+using asynchronous Python callables.
+
+See also:
+https://airflow.apache.org/docs/apache-airflow-providers-standard/stable/operators/python.html
 """
 
 from __future__ import annotations
@@ -48,6 +59,7 @@ with DAG(
     start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
     catchup=False,
     tags=["example"],
+    doc_md=__doc__,
 ) as dag:
     # [START howto_operator_python]
     def print_context(ds=None, **kwargs):

Reply via email to