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
  • Loading branch information
zhongjiajie authored Mar 20, 2020
1 parent a360024 commit ff3700d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
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 @@ -33,7 +33,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 }} </small>
<span style='color:#AAA;'>DAG: </span> <span> {{ dag.dag_id }}</span>
<small class="text-muted"> {{ dag.description[0:150] + '...' if dag.description and dag.description|length > 150 else dag.description|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/templates/airflow/dags.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ <h2>DAGs</h2>
<!-- Column 3: Name -->
<td>
<span>
<a href="{{ url_for('Airflow.'+ dag.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.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 ff3700d

Please sign in to comment.