diff --git a/UPDATING.md b/UPDATING.md index 5b28a5efc35b6..baa87a449a7f5 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -61,6 +61,11 @@ https://developers.google.com/style/inclusive-documentation --> + +### Use NULL as default value for dag.description + +Now use NULL as default value for dag.description in dag table + ### Assigning task to a DAG using bitwise shift (bit-shift) operators are no longer supported Previously, you could assign a task to a DAG as follows: diff --git a/airflow/models/dag.py b/airflow/models/dag.py index f9f9bec408222..a5642992a124d 100644 --- a/airflow/models/dag.py +++ b/airflow/models/dag.py @@ -210,7 +210,7 @@ class DAG(BaseDag, LoggingMixin): def __init__( self, dag_id: str, - description: str = '', + description: Optional[str] = None, schedule_interval: Optional[ScheduleInterval] = timedelta(days=1), start_date: Optional[datetime] = None, end_date: Optional[datetime] = None, diff --git a/airflow/www/templates/airflow/dag.html b/airflow/www/templates/airflow/dag.html index 893d3b0e8fec3..ded41def4c1f4 100644 --- a/airflow/www/templates/airflow/dag.html +++ b/airflow/www/templates/airflow/dag.html @@ -33,7 +33,8 @@

SUBDAG: {{ dag.dag_id }} {% else %} - DAG: {{ dag.dag_id }} {{ dag.description }} + DAG: {{ dag.dag_id }} + {{ dag.description[0:150] + '...' if dag.description and dag.description|length > 150 else dag.description|default('', true) }} {% endif %} {% if root %} ROOT: {{ root }} diff --git a/airflow/www/templates/airflow/dags.html b/airflow/www/templates/airflow/dags.html index cd6287ee61ad4..4d729538b0a69 100644 --- a/airflow/www/templates/airflow/dags.html +++ b/airflow/www/templates/airflow/dags.html @@ -99,7 +99,8 @@

DAGs

- + {{ dag.dag_id }}