Skip to content

Commit

Permalink
[AIRFLOW-6959] Use NULL as dag.description default value (#7593)
Browse files Browse the repository at this point in the history
(cherry-picked from ff3700d)
  • Loading branch information
zhongjiajie authored and kaxil committed Jun 5, 2020
1 parent 4827a67 commit d0de41c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
7 changes: 7 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ assists users migrating to a new version.
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of contents**

- [Airflow 1.10.11](#airflow-11011)
- [Airflow 1.10.10](#airflow-11010)
- [Airflow 1.10.9](#airflow-1109)
- [Airflow 1.10.8](#airflow-1108)
Expand Down Expand Up @@ -59,6 +60,12 @@ https://developers.google.com/style/inclusive-documentation
-->

## Airflow 1.10.11

### Use NULL as default value for dag.description

Now use NULL as default value for dag.description in dag table

## Airflow 1.10.10

### Setting Empty string to a Airflow Variable will return an empty string
Expand Down
2 changes: 1 addition & 1 deletion airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class DAG(BaseDag, LoggingMixin):
def __init__(
self,
dag_id, # type: str
description='', # type: str
description=None, # type: Optional[str]
schedule_interval=timedelta(days=1), # type: Optional[ScheduleInterval]
start_date=None, # type: Optional[datetime]
end_date=None, # type: Optional[datetime]
Expand Down
3 changes: 2 additions & 1 deletion airflow/www/templates/airflow/dag.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ <h3 class="pull-left">
<span style='color:#AAA;'>SUBDAG: </span> <span> {{ dag.dag_id }}</span>
{% else %}
<input id="pause_resume" dag_id="{{ dag.dag_id }}" type="checkbox" {{ "checked" if not dag.is_paused else "" }} data-toggle="toggle" data-size="mini" method="post">
<span style='color:#AAA;'>DAG: </span> <span> {{ dag.dag_id }}</span> <small class="text-muted"> {{ dag.description_unicode }} </small>
<span style='color:#AAA;'>DAG: </span> <span> {{ dag.dag_id }}</span>
<small class="text-muted"> {{ dag.description_unicode[0:150] + '...' if dag.description_unicode and dag.description_unicode|length > 150 else dag.description_unicode|default('', true) }} </small>
{% endif %}
{% if root %}
<span style='color:#AAA;'>ROOT: </span> <span> {{ root }}</span>
Expand Down
5 changes: 3 additions & 2 deletions airflow/www/templates/airflow/dags.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ <h2>DAGs</h2>

<!-- Column 3: Name -->
<td>
<a href="{{ url_for('airflow.'+ dag.get_default_view(), dag_id=dag.dag_id) }}" title="{{ dag.description[0:80] + '...' if dag.description|length > 80 else dag.description }}">
{{ dag.dag_id }}
<a href="{{ url_for('airflow.'+ dag.get_default_view(), dag_id=dag.dag_id) }}"
title="{{ dag.description[0:80] + '...' if dag.description and dag.description|length > 80 else dag.description|default('', true) }}">
{{ dag.dag_id }}
</a>
</td>

Expand Down
3 changes: 2 additions & 1 deletion airflow/www_rbac/templates/airflow/dag.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ <h3 class="pull-left">
<span style='color:#AAA;'>SUBDAG: </span> <span> {{ dag.dag_id }}</span>
{% else %}
<input id="pause_resume" dag_id="{{ dag.dag_id }}" type="checkbox" {{ "checked" if not dag.is_paused else "" }} data-toggle="toggle" data-size="mini" method="post">
<span style='color:#AAA;'>DAG: </span> <span> {{ dag.dag_id }}</span> <small class="text-muted"> {{ dag.description_unicode }} </small>
<span style='color:#AAA;'>DAG: </span> <span> {{ dag.dag_id }}</span>
<small class="text-muted"> {{ dag.description_unicode[0:150] + '...' if dag.description_unicode and dag.description_unicode|length > 150 else dag.description_unicode|default('', true) }} </small>
{% endif %}
{% if root %}
<span style='color:#AAA;'>ROOT: </span> <span> {{ root }}</span>
Expand Down
3 changes: 2 additions & 1 deletion airflow/www_rbac/templates/airflow/dags.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ <h2>DAGs</h2>
<!-- Column 3: Name -->
<td>
<span>
<a href="{{ url_for('Airflow.'+ dag.get_default_view(), dag_id=dag.dag_id) }}" title="{{ dag.description[0:80] + '...' if dag.description|length > 80 else dag.description }}">
<a href="{{ url_for('Airflow.'+ dag.get_default_view(), dag_id=dag.dag_id) }}"
title="{{ dag.description[0:80] + '...' if dag.description and dag.description|length > 80 else dag.description|default('', true) }}">
{{ dag.dag_id }}
</a>
</span>
Expand Down

0 comments on commit d0de41c

Please sign in to comment.