You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2021/09/10 12:50:20 UTC

[airflow] branch v2-1-test updated (6866a7c -> f9c337f)

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

kaxilnaik pushed a change to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git.


    from 6866a7c  Fix wrong query on running tis (#17631)
     new 8ecc710  Increase width for Run column (#17817)
     new d5ec5c7  Improve graph view load time for dags with open groups (#17821)
     new a8bbb83  Only show Pause/Unpause tooltip on hover (#17957)
     new 9f98a7d  Limit colorlog version (6.x is incompatible) (#18099)
     new f9c337f  Fix Sentry handler from LocalTaskJob causing error (#18119)

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 airflow/sentry.py                       | 15 ++++++++++++---
 airflow/www/static/js/dag.js            |  2 ++
 airflow/www/static/js/dags.js           |  4 +++-
 airflow/www/static/js/graph.js          | 18 ++++++++++--------
 airflow/www/templates/airflow/dags.html |  2 +-
 setup.cfg                               |  2 +-
 6 files changed, 29 insertions(+), 14 deletions(-)

[airflow] 02/05: Improve graph view load time for dags with open groups (#17821)

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit d5ec5c7ccc8eb06a311d4289b73e4ddc57d74810
Author: Emil Ejbyfeldt <ee...@liveintent.com>
AuthorDate: Thu Aug 26 14:53:44 2021 +0200

    Improve graph view load time for dags with open groups (#17821)
    
    * Only draw once during initial graph setup
    
    The previous behavior could cause significat slowness for when loading
    the graph view for large dags with many task groups.
    
    * Improve name and fix camelCased
    
    * Fix indent
    
    * PR suggestions remove args
    
    (cherry picked from commit bfdda083d684b279b6b07e79080373ae4d36939a)
---
 airflow/www/static/js/graph.js | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/airflow/www/static/js/graph.js b/airflow/www/static/js/graph.js
index 5d8ab8e..7aeedb1 100644
--- a/airflow/www/static/js/graph.js
+++ b/airflow/www/static/js/graph.js
@@ -149,6 +149,8 @@ function draw() {
       // A group node
       if (d3.event.defaultPrevented) return;
       expandGroup(nodeId, node);
+      draw();
+      focusGroup(nodeId);
     } else if (nodeId in tasks) {
       // A task node
       const task = tasks[nodeId];
@@ -451,6 +453,9 @@ function groupTooltip(nodeId, tis) {
 function updateNodesStates(tis) {
   for (const nodeId of g.nodes()) {
     const { elem } = g.node(nodeId);
+    if (!elem) {
+      return;
+    }
     elem.setAttribute('class', `node enter ${getNodeState(nodeId, tis)}`);
     elem.setAttribute('data-toggle', 'tooltip');
 
@@ -594,7 +599,7 @@ function focusGroup(nodeId) {
 }
 
 // Expands a group node
-function expandGroup(nodeId, node, focus = true) {
+function expandGroup(nodeId, node) {
   node.children.forEach((val) => {
     // Set children nodes
     g.setNode(val.id, val.value);
@@ -631,12 +636,6 @@ function expandGroup(nodeId, node, focus = true) {
     }
   });
 
-  draw();
-
-  if (focus) {
-    focusGroup(nodeId);
-  }
-
   saveExpandedGroup(nodeId);
 }
 
@@ -683,7 +682,7 @@ function expandSavedGroups(expandedGroups, node) {
 
   node.children.forEach((childNode) => {
     if (expandedGroups.has(childNode.id)) {
-      expandGroup(childNode.id, g.node(childNode.id), false);
+      expandGroup(childNode.id, g.node(childNode.id));
 
       expandSavedGroups(expandedGroups, childNode);
     }
@@ -700,6 +699,9 @@ expandGroup(null, nodes);
 // Expand the node that were previously expanded
 expandSavedGroups(expandedGroups, nodes);
 
+// Draw once after all groups have been expanded
+draw();
+
 // Restore focus (if available)
 if (g.hasNode(focusNodeId)) {
   focusGroup(focusNodeId);

[airflow] 01/05: Increase width for Run column (#17817)

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 8ecc7105de405553868e29ae133e131b5ff6d177
Author: Gabriel Machado <ga...@hotmail.com>
AuthorDate: Wed Aug 25 14:48:33 2021 +0200

    Increase width for Run column (#17817)
    
    (cherry picked from commit 96f7e3fec76a78f49032fbc9a4ee9a5551f38042)
---
 airflow/www/static/js/dags.js           | 2 +-
 airflow/www/templates/airflow/dags.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/www/static/js/dags.js b/airflow/www/static/js/dags.js
index 7056a60..7f27af8 100644
--- a/airflow/www/static/js/dags.js
+++ b/airflow/www/static/js/dags.js
@@ -167,7 +167,7 @@ function lastDagRunsHandler(error, json) {
 function drawDagStatsForDag(dagId, states) {
   const g = d3.select(`svg#dag-run-${dagId.replace(/\./g, '__dot__')}`)
     .attr('height', diameter + (strokeWidthHover * 2))
-    .attr('width', '110px')
+    .attr('width', '120px')
     .selectAll('g')
     .data(states)
     .enter()
diff --git a/airflow/www/templates/airflow/dags.html b/airflow/www/templates/airflow/dags.html
index 7535440..df43d70 100644
--- a/airflow/www/templates/airflow/dags.html
+++ b/airflow/www/templates/airflow/dags.html
@@ -154,7 +154,7 @@
                   {% endfor %}
                 </td>
                 {# Column 4: Dag Runs #}
-                <td style="padding:0; width:120px;">
+                <td style="padding:0; width:130px;">
                   {{ loading_dots(classes='js-loading-dag-stats text-muted') }}
                   <svg height="10" width="10" id="dag-run-{{ dag.safe_dag_id }}" style="display: block;"></svg>
                 </td>

[airflow] 03/05: Only show Pause/Unpause tooltip on hover (#17957)

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit a8bbb83a3d3aa05a4b68616035ea608249eaa502
Author: Brent Bovenzi <br...@gmail.com>
AuthorDate: Wed Sep 1 14:14:41 2021 +0200

    Only show Pause/Unpause tooltip on hover (#17957)
    
    After clicking on the Pause/Unpause toggle, the element remained in focus and therefore the toggle wouldn't go away. After a change event we will also trigger a blur event to remove the focus so the tooltip will only appear on hover.
    
    Fixes: #16500
    (cherry picked from commit ee93935bab6e5841b48a07028ea701d9aebe0cea)
---
 airflow/www/static/js/dag.js  | 2 ++
 airflow/www/static/js/dags.js | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/airflow/www/static/js/dag.js b/airflow/www/static/js/dag.js
index 39ffedc..7f5b4ae 100644
--- a/airflow/www/static/js/dag.js
+++ b/airflow/www/static/js/dag.js
@@ -254,6 +254,8 @@ $('#pause_resume').on('change', function onChange() {
   const id = $input.data('dag-id');
   const isPaused = $input.is(':checked');
   const url = `${pausedUrl}?is_paused=${isPaused}&dag_id=${encodeURIComponent(id)}`;
+  // Remove focus on element so the tooltip will go away
+  $input.trigger('blur');
   $input.removeClass('switch-input--error');
   $.post(url).fail(() => {
     setTimeout(() => {
diff --git a/airflow/www/static/js/dags.js b/airflow/www/static/js/dags.js
index 7f27af8..01da376 100644
--- a/airflow/www/static/js/dags.js
+++ b/airflow/www/static/js/dags.js
@@ -92,6 +92,8 @@ $.each($('[id^=toggle]'), function toggleId() {
     const isPaused = $input.is(':checked');
     const url = `${pausedUrl}?is_paused=${isPaused}&dag_id=${encodeURIComponent(dagId)}`;
     $input.removeClass('switch-input--error');
+    // Remove focus on element so the tooltip will go away
+    $input.trigger('blur');
     $.post(url).fail(() => {
       setTimeout(() => {
         $input.prop('checked', !isPaused);

[airflow] 05/05: Fix Sentry handler from LocalTaskJob causing error (#18119)

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit f9c337fb5a0290a38069a2adff5a8fcea806bf2b
Author: Robin Edwards <ro...@gmail.com>
AuthorDate: Fri Sep 10 00:14:36 2021 +0100

    Fix Sentry handler from LocalTaskJob causing error (#18119)
    
    The `enrich_errors` method assumes the first argument to the function
    its patch is a TaskInstance when infact it can also be a LocalTaskJob.
    
    This is now handled by extracting the task_instance from the
    LocalTaskJob
    
    Closes #18118
    
    (cherry picked from commit f97ddf10e148bd18b6a09ec96f1901068c8684f0)
---
 airflow/sentry.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/airflow/sentry.py b/airflow/sentry.py
index 51fe26f..9e271b4 100644
--- a/airflow/sentry.py
+++ b/airflow/sentry.py
@@ -148,11 +148,14 @@ if conf.getboolean("sentry", 'sentry_on', fallback=False):
                 sentry_sdk.add_breadcrumb(category="completed_tasks", data=data, level="info")
 
         def enrich_errors(self, func):
-            """Wrap TaskInstance._run_raw_task to support task specific tags and breadcrumbs."""
+            """
+            Wrap TaskInstance._run_raw_task and LocalTaskJob._run_mini_scheduler_on_child_tasks
+             to support task specific tags and breadcrumbs.
+            """
             session_args_idx = find_session_idx(func)
 
             @wraps(func)
-            def wrapper(task_instance, *args, **kwargs):
+            def wrapper(_self, *args, **kwargs):
                 # Wrapping the _run_raw_task function with push_scope to contain
                 # tags and breadcrumbs to a specific Task Instance
 
@@ -163,8 +166,14 @@ if conf.getboolean("sentry", 'sentry_on', fallback=False):
 
                 with sentry_sdk.push_scope():
                     try:
-                        return func(task_instance, *args, **kwargs)
+                        return func(_self, *args, **kwargs)
                     except Exception as e:
+                        # Is a LocalTaskJob get the task instance
+                        if hasattr(_self, 'task_instance'):
+                            task_instance = _self.task_instance
+                        else:
+                            task_instance = _self
+
                         self.add_tagging(task_instance)
                         self.add_breadcrumbs(task_instance, session=session)
                         sentry_sdk.capture_exception(e)

[airflow] 04/05: Limit colorlog version (6.x is incompatible) (#18099)

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 9f98a7d4319f2b1c7cf88f026f7f8442ff7d6560
Author: Malthe Borch <mb...@gmail.com>
AuthorDate: Thu Sep 9 00:05:34 2021 +0200

    Limit colorlog version (6.x is incompatible) (#18099)
    
    The "color" method seems to have been removed.
    
    (cherry picked from commit a1d91725bf7c842a72a9c174fecf9d9fc41ac5e5)
---
 setup.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.cfg b/setup.cfg
index d3c5f57..8774291 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -88,7 +88,7 @@ install_requires =
     cattrs~=1.1, <1.7.0;python_version>"3.6"
     # Required by vendored-in connexion
     clickclick>=1.2
-    colorlog>=4.0.2
+    colorlog>=4.0.2, <6.0
     croniter>=0.3.17, <1.1
     cryptography>=0.9.3
     dataclasses;python_version<"3.7"