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 2020/08/14 23:41:33 UTC

[airflow] branch v1-10-test updated (6b77671 -> ecc8e24)

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

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


    from 6b77671  Set language on code-block on docs/howto/email-config.rst (#10238)
     new e97794c  Allow `image` in `KubernetesPodOperator` to be templated (#10068)
     new 12c00b6  UI Graph View: Focus upstream / downstream task dependencies on mouseover (#9303)
     new 9d78eb9  Fix docstrings in BigQueryGetDataOperator (#10042)
     new ecc8e24  Create a short-link for Airflow Slack Invites (#10034)

The 4 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:
 README.md                                          |  3 +-
 airflow/contrib/operators/bigquery_get_data.py     |  2 +-
 .../contrib/operators/kubernetes_pod_operator.py   |  2 +-
 airflow/www_rbac/templates/airflow/graph.html      | 32 +++++++++++++++++-----
 .../kubernetes/operators/test_kubernetes_pod.py    | 13 +++++++++
 5 files changed, 42 insertions(+), 10 deletions(-)


[airflow] 01/04: Allow `image` in `KubernetesPodOperator` to be templated (#10068)

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

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

commit e97794cb6b87f258a0cf9a7facf98575cc825623
Author: Kaxil Naik <ka...@gmail.com>
AuthorDate: Fri Jul 31 14:25:08 2020 +0100

    Allow `image` in `KubernetesPodOperator` to be templated (#10068)
    
    fixes https://github.com/apache/airflow/issues/10063
    
    (cherry picked from commit 03c43517445019081c55b4ac5fad3b0debdee336)
---
 airflow/contrib/operators/kubernetes_pod_operator.py        |  2 +-
 .../cncf/kubernetes/operators/test_kubernetes_pod.py        | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/airflow/contrib/operators/kubernetes_pod_operator.py b/airflow/contrib/operators/kubernetes_pod_operator.py
index 98464b7..3c7c5a8 100644
--- a/airflow/contrib/operators/kubernetes_pod_operator.py
+++ b/airflow/contrib/operators/kubernetes_pod_operator.py
@@ -141,7 +141,7 @@ class KubernetesPodOperator(BaseOperator):  # pylint: disable=too-many-instance-
     :param pod_template_file: path to pod template file
     :type pod_template_file: str
     """
-    template_fields = ('cmds', 'arguments', 'env_vars', 'config_file', 'pod_template_file')
+    template_fields = ('image', 'cmds', 'arguments', 'env_vars', 'config_file', 'pod_template_file')
 
     @apply_defaults
     def __init__(self,  # pylint: disable=too-many-arguments,too-many-locals
diff --git a/tests/providers/cncf/kubernetes/operators/test_kubernetes_pod.py b/tests/providers/cncf/kubernetes/operators/test_kubernetes_pod.py
index f20ac2d..6b961e7 100644
--- a/tests/providers/cncf/kubernetes/operators/test_kubernetes_pod.py
+++ b/tests/providers/cncf/kubernetes/operators/test_kubernetes_pod.py
@@ -143,3 +143,16 @@ class TestKubernetesPodOperator(unittest.TestCase):
             context = self.create_context(k)
             k.execute(context=context)
         assert delete_pod_mock.called
+
+    def test_jinja_templated_fields(self):
+        task = KubernetesPodOperator(
+            namespace='default',
+            image="{{ image_jinja }}:16.04",
+            cmds=["bash", "-cx"],
+            name="test_pod",
+            task_id="task",
+        )
+
+        self.assertEqual(task.image, "{{ image_jinja }}:16.04")
+        task.render_template_fields(context={"image_jinja": "ubuntu"})
+        self.assertEqual(task.image, "ubuntu:16.04")


[airflow] 03/04: Fix docstrings in BigQueryGetDataOperator (#10042)

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

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

commit 9d78eb95e2f8de3f0d11c9738483a75e00a77988
Author: Jinhui Zhang <me...@old-panda.com>
AuthorDate: Wed Jul 29 05:42:41 2020 -0700

    Fix docstrings in BigQueryGetDataOperator (#10042)
    
    (cherry picked from commit 59cbff0874dd5318cda4b9ce7b7eeb1aad1dad4d)
---
 airflow/contrib/operators/bigquery_get_data.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/contrib/operators/bigquery_get_data.py b/airflow/contrib/operators/bigquery_get_data.py
index e16804b..288bf5f 100644
--- a/airflow/contrib/operators/bigquery_get_data.py
+++ b/airflow/contrib/operators/bigquery_get_data.py
@@ -45,7 +45,7 @@ class BigQueryGetDataOperator(BaseOperator):
             task_id='get_data_from_bq',
             dataset_id='test_dataset',
             table_id='Transaction_partitions',
-            max_results='100',
+            max_results=100,
             selected_fields='DATE',
             bigquery_conn_id='airflow-service-account'
         )


[airflow] 02/04: UI Graph View: Focus upstream / downstream task dependencies on mouseover (#9303)

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

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

commit 12c00b640b63cfb687ba6c90c89797a36a1d8fc6
Author: dstandish <ds...@users.noreply.github.com>
AuthorDate: Thu Jul 30 01:44:13 2020 -0700

    UI Graph View: Focus upstream / downstream task dependencies on mouseover (#9303)
    
    * graph view mouseover task should increase stroke width of upstream / downstream
    * mouseover should focus dependencies on mouseover in graph view
---
 airflow/www_rbac/templates/airflow/graph.html | 32 +++++++++++++++++++++------
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/airflow/www_rbac/templates/airflow/graph.html b/airflow/www_rbac/templates/airflow/graph.html
index 5fe326e..e794dc3 100644
--- a/airflow/www_rbac/templates/airflow/graph.html
+++ b/airflow/www_rbac/templates/airflow/graph.html
@@ -207,24 +207,42 @@
     });
 
 
-    function highlight_nodes(nodes, color) {
+    function highlight_nodes(nodes, color, stroke_width) {
         nodes.forEach (function (nodeid) {
             my_node = d3.select('[id="' + nodeid + '"]').node().parentNode;
-            d3.select(my_node).selectAll("rect").style("stroke", color) ;
+            d3.select(my_node)
+                .selectAll("rect")
+                .style("stroke", color)
+                .style("stroke-width", stroke_width) ;
         })
     }
 
     d3.selectAll("g.node").on("mouseover", function(d){
         d3.select(this).selectAll("rect").style("stroke", highlight_color) ;
-        highlight_nodes(g.predecessors(d), upstream_color);
-        highlight_nodes(g.successors(d), downstream_color)
-
+        highlight_nodes(g.predecessors(d), upstream_color, highlightStrokeWidth);
+        highlight_nodes(g.successors(d), downstream_color, highlightStrokeWidth)
+        adjacent_node_names = [d, ...g.predecessors(d), ...g.successors(d)]
+        d3.selectAll("g.nodes g.node")
+            .filter(x => !adjacent_node_names.includes(x))
+            .style("opacity", 0.2);
+        adjacent_edges = g.nodeEdges(d)
+        d3.selectAll("g.edgePath")[0]
+            .filter(x => !adjacent_edges.includes(x.__data__))
+            .forEach(function(x) {
+                d3.select(x).style('opacity', .2)
+            })
     });
 
     d3.selectAll("g.node").on("mouseout", function(d){
         d3.select(this).selectAll("rect").style("stroke", null) ;
-        highlight_nodes(g.predecessors(d), null)
-        highlight_nodes(g.successors(d), null)
+        highlight_nodes(g.predecessors(d), null, initialStrokeWidth)
+        highlight_nodes(g.successors(d), null, initialStrokeWidth)
+        d3.selectAll("g.node")
+            .style("opacity", 1);
+        d3.selectAll("g.node rect")
+            .style("stroke-width", initialStrokeWidth);
+        d3.selectAll("g.edgePath")
+            .style("opacity", 1);
     });
 
 


[airflow] 04/04: Create a short-link for Airflow Slack Invites (#10034)

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

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

commit ecc8e2470f0435fc962235e5b750c7f1f707baa0
Author: Kaxil Naik <ka...@gmail.com>
AuthorDate: Tue Jul 28 13:46:59 2020 +0100

    Create a short-link for Airflow Slack Invites (#10034)
    
    (cherry picked from commit 8de5ea30d3aac4ff62bf6b0c2621d1a0ce74e698)
---
 README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index c7f3ad0..867cb22 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,7 @@
 [![License](http://img.shields.io/:license-Apache%202-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)
 [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/apache-airflow.svg)](https://pypi.org/project/apache-airflow/)
 [![Twitter Follow](https://img.shields.io/twitter/follow/ApacheAirflow.svg?style=social&label=Follow)](https://twitter.com/ApacheAirflow)
+[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://s.apache.org/airflow-slack)
 
 _NOTE: The transition from 1.8.0 (or before) to 1.8.1 (or after) requires uninstalling Apache Airflow before installing the new version. The package name was changed from `airflow` to `apache-airflow` as of version 1.8.1._
 
@@ -415,5 +416,5 @@ Yes! Be sure to abide by the Apache Foundation [trademark policies](https://www.
 
 
 - [Documentation](https://airflow.apache.org/)
-- [Chat](https://apache-airflow-slack.herokuapp.com/)
+- [Chat](https://s.apache.org/airflow-slack)
 - [More](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Links)