[GitHub] [airflow] milton0825 opened a new pull request #4898: [AIRFLOW-XXXX] how to setup test env with mysql

2019-03-10 Thread GitBox
milton0825 opened a new pull request #4898: [AIRFLOW-] how to setup test 
env with mysql
URL: https://github.com/apache/airflow/pull/4898
 
 
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [ ] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
 - https://issues.apache.org/jira/browse/AIRFLOW-XXX
 - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-XXX\], code changes always need a Jira issue.
 - In case you are proposing a fundamental code change, you need to create 
an Airflow Improvement 
Proposal([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)).
   
   ### Description
   
   - [ ] Here are some details about my PR, including screenshots of any UI 
changes:
   
   ### Tests
   
   - [ ] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   
   ### Commits
   
   - [ ] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
 1. Subject is separated from body by a blank line
 1. Subject is limited to 50 characters (not including Jira issue reference)
 1. Subject does not end with a period
 1. Subject uses the imperative mood ("add", not "adding")
 1. Body wraps at 72 characters
 1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes 
how to use it.
 - When adding new operators/hooks/sensors, the autoclass documentation 
generation needs to be added.
 - All the public functions and the classes in the PR contain docstrings 
that explain what it does
 - If you implement backwards incompatible changes, please leave a note in 
the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so 
we can assign it to a appropriate release
   
   ### Code Quality
   
   - [ ] Passes `flake8`
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] ramandumcs commented on issue #4859: [AIRFLOW-3917] Added config to support running scheduler(with kuberne…

2019-03-10 Thread GitBox
ramandumcs commented on issue #4859: [AIRFLOW-3917] Added config to support 
running scheduler(with kuberne…
URL: https://github.com/apache/airflow/pull/4859#issuecomment-471408916
 
 
   RETEST


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4897: [AIRFLOW-4062] Clear install extra package command

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4897: [AIRFLOW-4062] Clear install extra 
package command
URL: https://github.com/apache/airflow/pull/4897#issuecomment-471405507
 
 
   @mik-laj `pip install apache-airflow[devel]` will get error in ubuntu, but 
`pip install 'apache-airflow[devel]'` will not


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4897: [AIRFLOW-4062] Clear install extra package command

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4897: [AIRFLOW-4062] Clear install extra 
package command
URL: https://github.com/apache/airflow/pull/4897#issuecomment-471405309
 
 
   PTAL @XD-DENG @feng-tao @Fokko 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on issue #4897: [AIRFLOW-4062] Clear install extra package command

2019-03-10 Thread GitBox
mik-laj commented on issue #4897: [AIRFLOW-4062] Clear install extra package 
command
URL: https://github.com/apache/airflow/pull/4897#issuecomment-471405267
 
 
   Why is it important?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4897: [AIRFLOW-4062] Clear install extra package command

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4897: [AIRFLOW-4062] Clear install extra 
package command
URL: https://github.com/apache/airflow/pull/4897#issuecomment-471405222
 
 
   I create jira ticket becase of change log code in 
https://github.com/apache/airflow/pull/4897/files#diff-e90ff8ca3f03b5d363736e93748ef634R67
 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (AIRFLOW-4062) Clear install extra package command

2019-03-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-4062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789159#comment-16789159
 ] 

ASF GitHub Bot commented on AIRFLOW-4062:
-

zhongjiajie commented on pull request #4897: [AIRFLOW-4062] Clear install extra 
package command
URL: https://github.com/apache/airflow/pull/4897
 
 
   Some command for installing extra packages are
   `pip install apache-airflow[devel]` we should
   clear install extra package command to
   `pip install 'apache-airflow[devel]'`
   
   [ci skip]
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues
 - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-4062\], code changes always need a Jira issue.
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   
   Some command for installing extra packages are
   `pip install apache-airflow[devel]` we should
   clear install extra package command to
   `pip install 'apache-airflow[devel]'`
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Clear install extra package command
> ---
>
> Key: AIRFLOW-4062
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4062
> Project: Apache Airflow
>  Issue Type: Improvement
>  Components: docs
>Affects Versions: 1.10.2
>Reporter: zhongjiajie
>Assignee: zhongjiajie
>Priority: Minor
>  Labels: easyfix
> Fix For: 1.10.3
>
>
> Some of our docs using 
> {code:java}
> pip install apache-airflow[devl]{code}
> I think we should clear the install command, change to 
> {code:java}
> pip install 'apache-airflow[devl]'{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] zhongjiajie opened a new pull request #4897: [AIRFLOW-4062] Clear install extra package command

2019-03-10 Thread GitBox
zhongjiajie opened a new pull request #4897: [AIRFLOW-4062] Clear install extra 
package command
URL: https://github.com/apache/airflow/pull/4897
 
 
   Some command for installing extra packages are
   `pip install apache-airflow[devel]` we should
   clear install extra package command to
   `pip install 'apache-airflow[devel]'`
   
   [ci skip]
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues
 - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-4062\], code changes always need a Jira issue.
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   
   Some command for installing extra packages are
   `pip install apache-airflow[devel]` we should
   clear install extra package command to
   `pip install 'apache-airflow[devel]'`


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] feng-tao commented on a change in pull request #4889: [AIRFLOW-4057] statsd should handle invalid characters

2019-03-10 Thread GitBox
feng-tao commented on a change in pull request #4889: [AIRFLOW-4057] statsd 
should handle invalid characters
URL: https://github.com/apache/airflow/pull/4889#discussion_r264091080
 
 

 ##
 File path: airflow/settings.py
 ##
 @@ -71,6 +74,42 @@ def timing(cls, stat, dt):
 
 Stats = DummyStatsLogger
 
+
+def validate_stat(f):
 
 Review comment:
   one suggestion: now we have `DummyStatsLogger` and `SafeStatsdLogger`, maybe 
we could move them to a separate file instead enlarging the setting.py file?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] feng-tao commented on a change in pull request #4889: [AIRFLOW-4057] statsd should handle invalid characters

2019-03-10 Thread GitBox
feng-tao commented on a change in pull request #4889: [AIRFLOW-4057] statsd 
should handle invalid characters
URL: https://github.com/apache/airflow/pull/4889#discussion_r264091527
 
 

 ##
 File path: airflow/settings.py
 ##
 @@ -71,6 +74,42 @@ def timing(cls, stat, dt):
 
 Stats = DummyStatsLogger
 
+
+def validate_stat(f):
+@wraps(f)
+def wrapper(stat, *args, **kwargs):
+try:
+validate_key(stat)
+except Exception as err:
+log.warning('Invalid stat name: {stat}.'.format(stat=stat), err)
+return
+return f(stat, *args, **kwargs)
+
+return wrapper
+
+
+class SafeStatsdLogger(object):
+
+def __init__(self, statsd_client):
+self.statsd = statsd_client
+
+@validate_stat
 
 Review comment:
   I am kinda confused on the valid / invalid meaning here for stats. Based on 
https://github.com/apache/airflow/blob/f8a24aaa94bbb6361510d58ae367d7e119c44e45/airflow/models/__init__.py#L2111,
 the `validate_key` is to validate the task_id name, but the stat name should 
be generic which shouldn't limit to task_id in this case.
   
   Are we agreed upon that stat name should follow the definition in 
`validate_key` as well?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Updated] (AIRFLOW-4062) Clear install extra package command

2019-03-10 Thread zhongjiajie (JIRA)


 [ 
https://issues.apache.org/jira/browse/AIRFLOW-4062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhongjiajie updated AIRFLOW-4062:
-
Summary: Clear install extra package command  (was: Clear install package 
command)

> Clear install extra package command
> ---
>
> Key: AIRFLOW-4062
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4062
> Project: Apache Airflow
>  Issue Type: Improvement
>  Components: docs
>Affects Versions: 1.10.2
>Reporter: zhongjiajie
>Assignee: zhongjiajie
>Priority: Minor
>  Labels: easyfix
> Fix For: 1.10.3
>
>
> Some of our docs using 
> {code:java}
> pip install apache-airflow[devl]{code}
> I think we should clear the install command, change to 
> {code:java}
> pip install 'apache-airflow[devl]'{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] feng-tao commented on a change in pull request #4889: [AIRFLOW-4057] statsd should handle invalid characters

2019-03-10 Thread GitBox
feng-tao commented on a change in pull request #4889: [AIRFLOW-4057] statsd 
should handle invalid characters
URL: https://github.com/apache/airflow/pull/4889#discussion_r264091527
 
 

 ##
 File path: airflow/settings.py
 ##
 @@ -71,6 +74,42 @@ def timing(cls, stat, dt):
 
 Stats = DummyStatsLogger
 
+
+def validate_stat(f):
+@wraps(f)
+def wrapper(stat, *args, **kwargs):
+try:
+validate_key(stat)
+except Exception as err:
+log.warning('Invalid stat name: {stat}.'.format(stat=stat), err)
+return
+return f(stat, *args, **kwargs)
+
+return wrapper
+
+
+class SafeStatsdLogger(object):
+
+def __init__(self, statsd_client):
+self.statsd = statsd_client
+
+@validate_stat
 
 Review comment:
   I am kinda confused on the valid / invalid meaning here for stats. Based 
onhttps://github.com/apache/airflow/blob/f8a24aaa94bbb6361510d58ae367d7e119c44e45/airflow/models/__init__.py#L2111,
 the `validate_key` is to validate the task_id name, but the stat name should 
be generic which shouldn't limit to task_id in this case.
   
   Are we agreed upon that stat name should follow the definition in 
`validate_key` as well?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Updated] (AIRFLOW-4062) Clear install package command

2019-03-10 Thread zhongjiajie (JIRA)


 [ 
https://issues.apache.org/jira/browse/AIRFLOW-4062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhongjiajie updated AIRFLOW-4062:
-
  Flags: Patch
 Labels: easyfix  (was: )
Description: 
Some of our docs using 
{code:java}
pip install apache-airflow[devl]{code}
I think we should clear the install command, change to 
{code:java}
pip install 'apache-airflow[devl]'{code}

  was:
Some of our docs using 
{code:java}
pip install apache-airflow[devl]{code}


> Clear install package command
> -
>
> Key: AIRFLOW-4062
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4062
> Project: Apache Airflow
>  Issue Type: Improvement
>  Components: docs
>Affects Versions: 1.10.2
>Reporter: zhongjiajie
>Assignee: zhongjiajie
>Priority: Minor
>  Labels: easyfix
> Fix For: 1.10.3
>
>
> Some of our docs using 
> {code:java}
> pip install apache-airflow[devl]{code}
> I think we should clear the install command, change to 
> {code:java}
> pip install 'apache-airflow[devl]'{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (AIRFLOW-4062) Clear install package command

2019-03-10 Thread zhongjiajie (JIRA)
zhongjiajie created AIRFLOW-4062:


 Summary: Clear install package command
 Key: AIRFLOW-4062
 URL: https://issues.apache.org/jira/browse/AIRFLOW-4062
 Project: Apache Airflow
  Issue Type: Improvement
  Components: docs
Affects Versions: 1.10.2
Reporter: zhongjiajie
Assignee: zhongjiajie
 Fix For: 1.10.3


Some of our docs using 
{code:java}
pip install apache-airflow[devl]{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] zhongjiajie commented on issue #4779: [AIRFLOW-3958] Support list tasks as upstream in chain

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4779: [AIRFLOW-3958] Support list tasks as 
upstream in chain
URL: https://github.com/apache/airflow/pull/4779#issuecomment-471402893
 
 
   @feng-tao I got your point. thanks


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on a change in pull request #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
zhongjiajie commented on a change in pull request #4895: [AIRFLOW-1526] Add 
dingding hook and operator
URL: https://github.com/apache/airflow/pull/4895#discussion_r264090337
 
 

 ##
 File path: airflow/contrib/hooks/dingding_webhook_hook.py
 ##
 @@ -0,0 +1,132 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import json
+
+from airflow import AirflowException
+from airflow.hooks.http_hook import HttpHook
+
+
+class DingdingWebhookHook(HttpHook):
+"""
+This hook allows you to post messages to Dingding use webhook.
+Given either manually token or http_conn_id has ``webhook_token`` as extra 
could work,
+if both of them are specific will use manual one.
+
+For more message detail in
+`Dingding custom bot 
`_
+
+:param http_conn_id: connection that has Dingding ``webhook_token`` in the 
extra field
+:type http_conn_id: str
+:param webhook_token: Dingding webhook token
+:type webhook_token: str
+:param message_type: Message type you want to send to Dingding
+ support text/link/markdown/actionCard/feedCard five 
types so far
+:type message_type: str
+:param message: The message you want to send on Dingding
+:type message: str or dict
+:param at_mobiles: Users you want to remind at this message.
+:type at_mobiles: list of str
+:param at_all: Should remind all people in group or not. If True, will 
overwrite ``at_mobiles``
+:type at_all: bool
+"""
+
+def __init__(self,
+ http_conn_id='dingding_webhook_default',
+ webhook_token=None,
+ message_type='text',
+ message=None,
+ at_mobiles=False,
+ at_all=False,
+ *args,
+ **kwargs
+ ):
+super(DingdingWebhookHook, self).__init__(*args, **kwargs)
+self.http_conn_id = http_conn_id
+self.endpoint = self._get_endpoint(webhook_token, http_conn_id)
+self.message_type = message_type
+self.message = message
+self.at_mobiles = at_mobiles
+self.at_all = at_all
+
+def _get_endpoint(self, manual_token, http_conn_id):
+"""
+Get Dingding endpoint for sending message. If both ``manual_token`` and
+``http_conn_id`` specific, use ``manual_token``
+
+:param manual_token: Manually provided token
+:type manual_token: str
+:param http_conn_id: http_conn_id provided
+:type http_conn_id: str
+"""
+if manual_token:
+token = manual_token
+elif http_conn_id:
+conn = self.get_connection(http_conn_id)
+extra = conn.extra_dejson
+token = extra.get('webhook_token')
+else:
+raise AirflowException('Cannot get token: No valid Dingding '
+   'webhook token nor http_conn_id supplied')
+return 'robot/send?access_token={}'.format(token)
+
+def _build_message(self):
+"""
+Build different type of Dingding message
+As most commonly used type, text message just need post message content
+rather than a dict like ``{'content': 'message'}``
+"""
+if self.message_type in ['text', 'markdown']:
+data = {
+'msgtype': self.message_type,
+self.message_type: {
+'content': self.message
+} if self.message_type == 'text' else self.message,
+'at': {
+'atMobiles': self.at_mobiles,
+'isAtAll': self.at_all
+}
+}
+else:
+data = {
+'msgtype': self.message_type,
+self.message_type: self.message
+}
+return json.dumps(data)
+
+def send(self):
 
 Review comment:
   I think is a minor change, I will keep the old function name.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL 

[GitHub] [airflow] zhongjiajie commented on a change in pull request #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
zhongjiajie commented on a change in pull request #4895: [AIRFLOW-1526] Add 
dingding hook and operator
URL: https://github.com/apache/airflow/pull/4895#discussion_r264090337
 
 

 ##
 File path: airflow/contrib/hooks/dingding_webhook_hook.py
 ##
 @@ -0,0 +1,132 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import json
+
+from airflow import AirflowException
+from airflow.hooks.http_hook import HttpHook
+
+
+class DingdingWebhookHook(HttpHook):
+"""
+This hook allows you to post messages to Dingding use webhook.
+Given either manually token or http_conn_id has ``webhook_token`` as extra 
could work,
+if both of them are specific will use manual one.
+
+For more message detail in
+`Dingding custom bot 
`_
+
+:param http_conn_id: connection that has Dingding ``webhook_token`` in the 
extra field
+:type http_conn_id: str
+:param webhook_token: Dingding webhook token
+:type webhook_token: str
+:param message_type: Message type you want to send to Dingding
+ support text/link/markdown/actionCard/feedCard five 
types so far
+:type message_type: str
+:param message: The message you want to send on Dingding
+:type message: str or dict
+:param at_mobiles: Users you want to remind at this message.
+:type at_mobiles: list of str
+:param at_all: Should remind all people in group or not. If True, will 
overwrite ``at_mobiles``
+:type at_all: bool
+"""
+
+def __init__(self,
+ http_conn_id='dingding_webhook_default',
+ webhook_token=None,
+ message_type='text',
+ message=None,
+ at_mobiles=False,
+ at_all=False,
+ *args,
+ **kwargs
+ ):
+super(DingdingWebhookHook, self).__init__(*args, **kwargs)
+self.http_conn_id = http_conn_id
+self.endpoint = self._get_endpoint(webhook_token, http_conn_id)
+self.message_type = message_type
+self.message = message
+self.at_mobiles = at_mobiles
+self.at_all = at_all
+
+def _get_endpoint(self, manual_token, http_conn_id):
+"""
+Get Dingding endpoint for sending message. If both ``manual_token`` and
+``http_conn_id`` specific, use ``manual_token``
+
+:param manual_token: Manually provided token
+:type manual_token: str
+:param http_conn_id: http_conn_id provided
+:type http_conn_id: str
+"""
+if manual_token:
+token = manual_token
+elif http_conn_id:
+conn = self.get_connection(http_conn_id)
+extra = conn.extra_dejson
+token = extra.get('webhook_token')
+else:
+raise AirflowException('Cannot get token: No valid Dingding '
+   'webhook token nor http_conn_id supplied')
+return 'robot/send?access_token={}'.format(token)
+
+def _build_message(self):
+"""
+Build different type of Dingding message
+As most commonly used type, text message just need post message content
+rather than a dict like ``{'content': 'message'}``
+"""
+if self.message_type in ['text', 'markdown']:
+data = {
+'msgtype': self.message_type,
+self.message_type: {
+'content': self.message
+} if self.message_type == 'text' else self.message,
+'at': {
+'atMobiles': self.at_mobiles,
+'isAtAll': self.at_all
+}
+}
+else:
+data = {
+'msgtype': self.message_type,
+self.message_type: self.message
+}
+return json.dumps(data)
+
+def send(self):
 
 Review comment:
   I think is a monor change, I will keep the old function name.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL 

[GitHub] [airflow] feng-tao commented on issue #4779: [AIRFLOW-3958] Support list tasks as upstream in chain

2019-03-10 Thread GitBox
feng-tao commented on issue #4779: [AIRFLOW-3958] Support list tasks as 
upstream in chain
URL: https://github.com/apache/airflow/pull/4779#issuecomment-471401338
 
 
   @zhongjiajie , I personally prefer one suggested approach instead of 
multiple different approaches. I am open to other committers' opinions. But 
IMO, I would prefer we stick with the `t1 >> t2 >> [t3, t4] >> t5` approach and 
remove the chain method which was created 3 year ago and never get updated. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
zhongjiajie edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook 
and operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471401041
 
 
   > The implementation is a bit tricky to me. It's dependent on the Dingtalk's 
single API endpoint (https://oapi.dingtalk.com).
   > 
   > The scope of this PR itself is similar to Slack-related hooks/operators. 
However, they were implemented on top of `slackclient` 
(https://github.com/apache/airflow/blob/master/airflow/hooks/slack_hook.py)
   
   @XD-DENG  slack have officail client, but dingtalk not, as @mik-laj said we 
have two slack hook, one is base on `slackclient` another are on webhook. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471401041
 
 
   > The implementation is a bit tricky to me. It's dependent on the Dingtalk's 
single API endpoint (https://oapi.dingtalk.com).
   > 
   > The scope of this PR itself is similar to Slack-related hooks/operators. 
However, they were implemented on top of `slackclient` 
(https://github.com/apache/airflow/blob/master/airflow/hooks/slack_hook.py)
   
   slack have officail client, but dingtalk not, as @mik-laj said we have two 
slack hook, one is base on `slackclient` another are on webhook. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] XD-DENG commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor

2019-03-10 Thread GitBox
XD-DENG commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor
URL: https://github.com/apache/airflow/pull/4887#issuecomment-471400222
 
 
   @mans2singh Then seems you're writing a `broker`/`operator` to move messages 
from SQS to XCom? But The purpose of having a `sensor` is to check if a 
specific condition is met (`Sensor operators keep executing at a time interval 
and succeed when a criteria is met and fail if and when they time out.`).


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4779: [AIRFLOW-3958] Support list tasks as upstream in chain

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4779: [AIRFLOW-3958] Support list tasks as 
upstream in chain
URL: https://github.com/apache/airflow/pull/4779#issuecomment-471400185
 
 
   @feng-tao But `chain` is helpful in some situation. do you think so.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] feng-tao commented on a change in pull request #4862: [AIRFLOW-4035] Remove DagBag from /graph

2019-03-10 Thread GitBox
feng-tao commented on a change in pull request #4862: [AIRFLOW-4035] Remove 
DagBag from /graph
URL: https://github.com/apache/airflow/pull/4862#discussion_r264088617
 
 

 ##
 File path: tests/www/test_views.py
 ##
 @@ -755,6 +755,7 @@ def setUp(self):
 from airflow.www.views import dagbag
 from airflow.utils.state import State
 dag = DAG(self.DAG_ID, start_date=self.DEFAULT_DATE)
+dag.sync_to_db()
 
 Review comment:
   Why do we add many sync_to_db method to different tests?  I saw this kinda 
change in many of your prs.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4779: [AIRFLOW-3958] Support list tasks as upstream in chain

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4779: [AIRFLOW-3958] Support list tasks as 
upstream in chain
URL: https://github.com/apache/airflow/pull/4779#issuecomment-471399937
 
 
   @mik-laj In this situation, I think it better to create new file in 
`docs/howto` first, due to we don't have clearly idea on how to divide exists 
docs


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471397663
 
 
   @zhongjiajie The howto documentation is recommended, but not required. If 
you have the time and desire then I will be happy when you write. 
   The guide should contain such sections: 
   * short description of service, 
   * the scenario - not required
   * prerequisite tasks, 
   * how to use. 
   
   Good example is: 
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-example-creating-buckets.html
   
   Fragment of the code should be attached using the `literalinclude` 
directive. It allows its automatic validation and allows to add link to full 
file ( https://github.com/apache/airflow/pull/4894 )
   
   Currently, the guides do not contain all sections, but I plan to develop 
them.
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] KevinYang21 commented on issue #4867: [AIRFLOW-3831] Remove DagBag from /pickle_info

2019-03-10 Thread GitBox
KevinYang21 commented on issue #4867: [AIRFLOW-3831] Remove DagBag from 
/pickle_info
URL: https://github.com/apache/airflow/pull/4867#issuecomment-471399873
 
 
   @feng-tao good call, +1 on hold for a bit.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] feng-tao commented on a change in pull request #4867: [AIRFLOW-3831] Remove DagBag from /pickle_info

2019-03-10 Thread GitBox
feng-tao commented on a change in pull request #4867: [AIRFLOW-3831] Remove 
DagBag from /pickle_info
URL: https://github.com/apache/airflow/pull/4867#discussion_r264088370
 
 

 ##
 File path: airflow/www/views.py
 ##
 @@ -466,17 +466,36 @@ def show_traceback(self):
 @expose('/pickle_info')
 @has_access
 def pickle_info(self):
-d = {}
-filter_dag_ids = appbuilder.sm.get_accessible_dag_ids()
-if not filter_dag_ids:
+"""Return pickle information for given DAG ids."""
+allowed_dag_ids = appbuilder.sm.get_accessible_dag_ids()
+if not allowed_dag_ids:
 return wwwutils.json_response({})
+
 dag_id = request.args.get('dag_id')
-dags = [dagbag.dags.get(dag_id)] if dag_id else dagbag.dags.values()
-for dag in dags:
-if 'all_dags' in filter_dag_ids or dag.dag_id in filter_dag_ids:
-if not dag.is_subdag:
-d[dag.dag_id] = dag.pickle_info()
-return wwwutils.json_response(d)
+# Check if dag_id is allowed to be accessed
+if dag_id and allowed_dag_ids != {"all_dags"} and dag_id not in 
allowed_dag_ids:
 
 Review comment:
   @ashb , but it can't use the decorator as the dag_id is not passed to the 
this blueprint method. I haven't looked at other similar prs, but I hope we 
don't change into this pr's approach.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] feng-tao commented on a change in pull request #4867: [AIRFLOW-3831] Remove DagBag from /pickle_info

2019-03-10 Thread GitBox
feng-tao commented on a change in pull request #4867: [AIRFLOW-3831] Remove 
DagBag from /pickle_info
URL: https://github.com/apache/airflow/pull/4867#discussion_r264088370
 
 

 ##
 File path: airflow/www/views.py
 ##
 @@ -466,17 +466,36 @@ def show_traceback(self):
 @expose('/pickle_info')
 @has_access
 def pickle_info(self):
-d = {}
-filter_dag_ids = appbuilder.sm.get_accessible_dag_ids()
-if not filter_dag_ids:
+"""Return pickle information for given DAG ids."""
+allowed_dag_ids = appbuilder.sm.get_accessible_dag_ids()
+if not allowed_dag_ids:
 return wwwutils.json_response({})
+
 dag_id = request.args.get('dag_id')
-dags = [dagbag.dags.get(dag_id)] if dag_id else dagbag.dags.values()
-for dag in dags:
-if 'all_dags' in filter_dag_ids or dag.dag_id in filter_dag_ids:
-if not dag.is_subdag:
-d[dag.dag_id] = dag.pickle_info()
-return wwwutils.json_response(d)
+# Check if dag_id is allowed to be accessed
+if dag_id and allowed_dag_ids != {"all_dags"} and dag_id not in 
allowed_dag_ids:
 
 Review comment:
   @ashb , but it can't use the decorator as the dag_id is not passed from the 
this blueprint method. I haven't looked at other similar prs, but I hope we 
don't change into this pr's approach.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on a change in pull request #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj commented on a change in pull request #4895: [AIRFLOW-1526] Add 
dingding hook and operator
URL: https://github.com/apache/airflow/pull/4895#discussion_r264088289
 
 

 ##
 File path: airflow/contrib/hooks/dingding_webhook_hook.py
 ##
 @@ -0,0 +1,132 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import json
+
+from airflow import AirflowException
+from airflow.hooks.http_hook import HttpHook
+
+
+class DingdingWebhookHook(HttpHook):
+"""
+This hook allows you to post messages to Dingding use webhook.
+Given either manually token or http_conn_id has ``webhook_token`` as extra 
could work,
+if both of them are specific will use manual one.
+
+For more message detail in
+`Dingding custom bot 
`_
+
+:param http_conn_id: connection that has Dingding ``webhook_token`` in the 
extra field
+:type http_conn_id: str
+:param webhook_token: Dingding webhook token
+:type webhook_token: str
+:param message_type: Message type you want to send to Dingding
+ support text/link/markdown/actionCard/feedCard five 
types so far
+:type message_type: str
+:param message: The message you want to send on Dingding
+:type message: str or dict
+:param at_mobiles: Users you want to remind at this message.
+:type at_mobiles: list of str
+:param at_all: Should remind all people in group or not. If True, will 
overwrite ``at_mobiles``
+:type at_all: bool
+"""
+
+def __init__(self,
+ http_conn_id='dingding_webhook_default',
+ webhook_token=None,
+ message_type='text',
+ message=None,
+ at_mobiles=False,
+ at_all=False,
+ *args,
+ **kwargs
+ ):
+super(DingdingWebhookHook, self).__init__(*args, **kwargs)
+self.http_conn_id = http_conn_id
+self.endpoint = self._get_endpoint(webhook_token, http_conn_id)
+self.message_type = message_type
+self.message = message
+self.at_mobiles = at_mobiles
+self.at_all = at_all
+
+def _get_endpoint(self, manual_token, http_conn_id):
+"""
+Get Dingding endpoint for sending message. If both ``manual_token`` and
+``http_conn_id`` specific, use ``manual_token``
+
+:param manual_token: Manually provided token
+:type manual_token: str
+:param http_conn_id: http_conn_id provided
+:type http_conn_id: str
+"""
+if manual_token:
+token = manual_token
+elif http_conn_id:
+conn = self.get_connection(http_conn_id)
+extra = conn.extra_dejson
+token = extra.get('webhook_token')
+else:
+raise AirflowException('Cannot get token: No valid Dingding '
+   'webhook token nor http_conn_id supplied')
+return 'robot/send?access_token={}'.format(token)
+
+def _build_message(self):
+"""
+Build different type of Dingding message
+As most commonly used type, text message just need post message content
+rather than a dict like ``{'content': 'message'}``
+"""
+if self.message_type in ['text', 'markdown']:
+data = {
+'msgtype': self.message_type,
+self.message_type: {
+'content': self.message
+} if self.message_type == 'text' else self.message,
+'at': {
+'atMobiles': self.at_mobiles,
+'isAtAll': self.at_all
+}
+}
+else:
+data = {
+'msgtype': self.message_type,
+self.message_type: self.message
+}
+return json.dumps(data)
+
+def send(self):
 
 Review comment:
   ```suggestion
   def send_message(self):
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to 

[GitHub] [airflow] mans2singh commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor

2019-03-10 Thread GitBox
mans2singh commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor
URL: https://github.com/apache/airflow/pull/4887#issuecomment-471399392
 
 
   @XD-DENG - I was thinking that passing the message via xcom will allow the 
subsequent operators to act on the message received.  Let me know if you have 
any recommendations.  Thanks


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] feng-tao commented on issue #4867: [AIRFLOW-3831] Remove DagBag from /pickle_info

2019-03-10 Thread GitBox
feng-tao commented on issue #4867: [AIRFLOW-3831] Remove DagBag from 
/pickle_info
URL: https://github.com/apache/airflow/pull/4867#issuecomment-471399383
 
 
   Besides there are still discussions over the implementation on the AIP, 
should we hold off this kinda remove dagbag pr before we finalize and make the 
vote of the AIP? @ashb @Fokko @KevinYang21 @aoen 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] feng-tao commented on a change in pull request #4867: [AIRFLOW-3831] Remove DagBag from /pickle_info

2019-03-10 Thread GitBox
feng-tao commented on a change in pull request #4867: [AIRFLOW-3831] Remove 
DagBag from /pickle_info
URL: https://github.com/apache/airflow/pull/4867#discussion_r264088033
 
 

 ##
 File path: airflow/www/views.py
 ##
 @@ -466,17 +466,36 @@ def show_traceback(self):
 @expose('/pickle_info')
 @has_access
 def pickle_info(self):
-d = {}
-filter_dag_ids = appbuilder.sm.get_accessible_dag_ids()
-if not filter_dag_ids:
+"""Return pickle information for given DAG ids."""
+allowed_dag_ids = appbuilder.sm.get_accessible_dag_ids()
+if not allowed_dag_ids:
 return wwwutils.json_response({})
+
 dag_id = request.args.get('dag_id')
-dags = [dagbag.dags.get(dag_id)] if dag_id else dagbag.dags.values()
-for dag in dags:
-if 'all_dags' in filter_dag_ids or dag.dag_id in filter_dag_ids:
-if not dag.is_subdag:
-d[dag.dag_id] = dag.pickle_info()
-return wwwutils.json_response(d)
+# Check if dag_id is allowed to be accessed
+if dag_id and allowed_dag_ids != {"all_dags"} and dag_id not in 
allowed_dag_ids:
 
 Review comment:
   Agree @ashb , all the security context should only live within security 
manager instead of leaking it out into the view.py file.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471397663
 
 
   @zhongjiajie The howto documentation is recommended, but not required. If 
you have the time and desire then I will be happy when you write. 
   The guide should contain such sections: 
   * short description of service, 
   * the scenario, 
   * prerequisite tasks, 
   * how to use. 
   
   Good example is: 
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-example-creating-buckets.html
   
   Fragment of the code should be attached using the `literalinclude` 
directive. It allows its automatic validation and allows to add link to full 
file ( https://github.com/apache/airflow/pull/4894 )
   
   Currently, the guides do not contain all sections, but I plan to develop 
them.
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471397663
 
 
   @zhongjiajie The howto documentation is recommended, but not required. If 
you have the time and desire then I will be happy when you write. 
   The guide should contain such sections: 
   * short description of service, 
   * the scenario, 
   * prerequisite tasks, 
   * how to use. 
   Good example is: 
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-example-creating-buckets.html
   Currently, the guides do not contain all sections, but I plan to develop 
them.
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471397663
 
 
   @zhongjiajie The howto documentation is recommended, but not required. If 
you have the time and desire then I will be happy when you write. The guide 
should contain such sections: short description of service, the scenario, 
prerequisite tasks, how to use. Good example is: 
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-example-creating-buckets.html
   Currently, the guides do not contain all sections, but I plan to develop 
them.
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] jmcarp commented on issue #4685: [AIRFLOW-3862] Check types with mypy.

2019-03-10 Thread GitBox
jmcarp commented on issue #4685: [AIRFLOW-3862] Check types with mypy.
URL: https://github.com/apache/airflow/pull/4685#issuecomment-471397297
 
 
   Conflicts resolved, helper methods made private. Ready for another look when 
you have time @ashb.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] jmcarp commented on issue #4732: [AIRFLOW-XXXX] Update to travis xenial infrastructure.

2019-03-10 Thread GitBox
jmcarp commented on issue #4732: [AIRFLOW-] Update to travis xenial 
infrastructure.
URL: https://github.com/apache/airflow/pull/4732#issuecomment-471397163
 
 
   See above; now this patch just drops `sudo`, which is deprecated on travis 
xenial.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] jmcarp commented on a change in pull request #4732: [AIRFLOW-XXXX] Update to travis xenial infrastructure.

2019-03-10 Thread GitBox
jmcarp commented on a change in pull request #4732: [AIRFLOW-] Update to 
travis xenial infrastructure.
URL: https://github.com/apache/airflow/pull/4732#discussion_r264086365
 
 

 ##
 File path: .travis.yml
 ##
 @@ -16,7 +16,6 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-sudo: true
 dist: xenial
 
 Review comment:
   Yep, looks like that change got through after I submitted this. I just 
updated this patch so that it just drops the deprecated `sudo` flag from travis.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] feng-tao commented on issue #4779: [AIRFLOW-3958] Support list tasks as upstream in chain

2019-03-10 Thread GitBox
feng-tao commented on issue #4779: [AIRFLOW-3958] Support list tasks as 
upstream in chain
URL: https://github.com/apache/airflow/pull/4779#issuecomment-471396930
 
 
   Agree with @feluelle that `t1 >> t2 >> [t3, t4] >> t5` is supported and 
should be the suggested or prefer way to set dependency.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471396918
 
 
   @XD-DENG we have a two hooks for Slack :-)  Look at 
https://github.com/apache/airflow/blob/master/airflow/contrib/hooks/slack_webhook_hook.py.
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on issue #4779: [AIRFLOW-3958] Support list tasks as upstream in chain

2019-03-10 Thread GitBox
mik-laj commented on issue #4779: [AIRFLOW-3958] Support list tasks as upstream 
in chain
URL: https://github.com/apache/airflow/pull/4779#issuecomment-471395914
 
 
   I think that now the documentation has one problem that should be solved 
first. The concepts.rst file is too large. We must think how to divide it and 
what new files to create. For example, the `.airflowignore` section is a rarely 
used feature and should not be included in this file. This file should contain 
the main concepts.
   
   Creating new files in the howto directory is the easiest way, because it is 
not required for the file to be one with the rest of the documentation. If you 
do not have a lot of time, you can create a new guide. Otherwise, you should 
think about creating a new file or files in main directory, which will contain 
other elements from the concept file.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Resolved] (AIRFLOW-4033) Record stats of task duration

2019-03-10 Thread Tao Feng (JIRA)


 [ 
https://issues.apache.org/jira/browse/AIRFLOW-4033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tao Feng resolved AIRFLOW-4033.
---
   Resolution: Fixed
Fix Version/s: 1.10.3

> Record stats of task duration
> -
>
> Key: AIRFLOW-4033
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4033
> Project: Apache Airflow
>  Issue Type: New Feature
>Reporter: Chao-Han Tsai
>Assignee: Chao-Han Tsai
>Priority: Major
> Fix For: 1.10.3
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AIRFLOW-4033) Record stats of task duration

2019-03-10 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-4033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789135#comment-16789135
 ] 

ASF subversion and git services commented on AIRFLOW-4033:
--

Commit f8a24aaa94bbb6361510d58ae367d7e119c44e45 in airflow's branch 
refs/heads/master from Chao-Han Tsai
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=f8a24aa ]

[AIRFLOW-4033] record stats of task duration (#4858)

update docs

fix

> Record stats of task duration
> -
>
> Key: AIRFLOW-4033
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4033
> Project: Apache Airflow
>  Issue Type: New Feature
>Reporter: Chao-Han Tsai
>Assignee: Chao-Han Tsai
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] feng-tao merged pull request #4858: [AIRFLOW-4033] record stats of task duration

2019-03-10 Thread GitBox
feng-tao merged pull request #4858: [AIRFLOW-4033] record stats of task duration
URL: https://github.com/apache/airflow/pull/4858
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (AIRFLOW-4033) Record stats of task duration

2019-03-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-4033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789134#comment-16789134
 ] 

ASF GitHub Bot commented on AIRFLOW-4033:
-

feng-tao commented on pull request #4858: [AIRFLOW-4033] record stats of task 
duration
URL: https://github.com/apache/airflow/pull/4858
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Record stats of task duration
> -
>
> Key: AIRFLOW-4033
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4033
> Project: Apache Airflow
>  Issue Type: New Feature
>Reporter: Chao-Han Tsai
>Assignee: Chao-Han Tsai
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] XD-DENG commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
XD-DENG commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471395310
 
 
   The implementation is a bit tricky to me. It's dependent on the Dingtalk's 
single API endpoint (https://oapi.dingtalk.com).
   
   The scope of this PR itself is similar to Slack-related hooks/operators. 
However, they were implemented on top of `slackclient` 
(https://github.com/apache/airflow/blob/master/airflow/hooks/slack_hook.py)


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] feng-tao commented on issue #4893: [DRAFT] [AIRFLOW-3891] Make the Graph View time-zone aware

2019-03-10 Thread GitBox
feng-tao commented on issue #4893: [DRAFT] [AIRFLOW-3891] Make the Graph View 
time-zone aware
URL: https://github.com/apache/airflow/pull/4893#issuecomment-471395220
 
 
   hey @astahlman , does the default timezone in UI based on a config? 
Currently there is a 
config(https://github.com/apache/airflow/blob/master/airflow/config_templates/default_airflow.cfg#L78)
 to decide the default timezone for scheduler. I wonder whether we could do 
something similar in webserver as well.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471394139
 
 
   @mik-laj Ok, your right, I will remove pass token from operator. do you 
think I should add some docs to describe in `howto` let people know how to use 
this hook or operator?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4779: [AIRFLOW-3958] Support list tasks as upstream in chain

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4779: [AIRFLOW-3958] Support list tasks as 
upstream in chain
URL: https://github.com/apache/airflow/pull/4779#issuecomment-471393543
 
 
   @mik-laj I have a plan to add `set-dependencies.rst` in `docs/howto` section 
after this PR be merge. I think we could ref from 
https://airflow.readthedocs.io/en/latest/tutorial.html#setting-up-dependencies 
to `set-dependencies.rst` and write some example let user know dependencies 
skill in daily job.
   
   what do you think?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471392237
 
 
   I know there are two ways but I think one of them is not safe and should not 
be supported. First, security should be a standard, not an option to choose 
from. people are too lazy and therefore do not make good choices about 
security. Second, the code of operators that is in the core is used to learning 
and therefore it should not have security flaws.
   
   I develop a operators for GCP Transfer Service. and I intentionally blocked 
the passing of passwords as parameters to limit the misuse of the operator.
   
https://github.com/apache/airflow/pull/4792/files#diff-1f5fe79c9bd42285838bf61cf696ea2bR136


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471392237
 
 
   I know there are two ways but I think one of them is not safe and should not 
be supported. Security should be a standard, not an option to choose from. the 
code of operators that is in the core is used to learning and therefore it 
should not have security flaws.
   
   I develop a operators for GCP Transfer Service. and I intentionally blocked 
the passing of passwords as parameters to limit the misuse of the operator.
   
https://github.com/apache/airflow/pull/4792/files#diff-1f5fe79c9bd42285838bf61cf696ea2bR136


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471392237
 
 
   I know there are two ways but I think one of them is not safe and should not 
be handled. Security should be a standard, not an option to choose from. the 
code of operators that is in the core is used to learning and therefore it 
should not have security flaws.
   
   I develop a operators for GCP Transfer Service. and I intentionally blocked 
the passing of passwords as parameters to limit the misuse of the operator.
   
https://github.com/apache/airflow/pull/4792/files#diff-1f5fe79c9bd42285838bf61cf696ea2bR136


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471392237
 
 
   I know there are two ways but I think one of them is not safe and should not 
be handled. Security should be a standard, not an option to choose from. the 
code of operators that is in the core is used to learning and therefore it 
should not have security flaws.
   
   I develop a operators for GCP Transfer Service. and I intentionally blocked 
the passing of passwords as parameters to limit the misuse of the operator.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471392237
 
 
   I know there are two ways but I think one of them is not safe and should not 
be handled. Security should be a standard, not an option to choose from. the 
code of operators that is in the core is used is learning and therefore it 
should not have security flaws.
   
   I develop a operators for GCP Transfer Service. and I intentionally blocked 
the passing of passwords as parameters to limit the misuse of the operator.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471392237
 
 
   I know there are two ways but I think one of them is not safe and should not 
be handled. Security should be a standard, not an option to choose from. the 
code of operators that is in the core is used is learning and therefore it 
should not have security flaws.
   
   I develop a operators for GCP Transfer Service 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie edited a comment on issue #4896: [AIRFLOW-4061] Remove incubator in CI process

2019-03-10 Thread GitBox
zhongjiajie edited a comment on issue #4896: [AIRFLOW-4061] Remove incubator in 
CI process
URL: https://github.com/apache/airflow/pull/4896#issuecomment-471388953
 
 
   @XD-DENG Never mind, I thought you had seen it :smile:. just let comment for 
other committer/PMC member?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4896: [AIRFLOW-4061] Remove incubator in CI process

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4896: [AIRFLOW-4061] Remove incubator in CI 
process
URL: https://github.com/apache/airflow/pull/4896#issuecomment-471388953
 
 
   @XD-DENG I thought you had seen it :smile:. just let comment for other 
committer/PMC member?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on a change in pull request #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
zhongjiajie commented on a change in pull request #4895: [AIRFLOW-1526] Add 
dingding hook and operator
URL: https://github.com/apache/airflow/pull/4895#discussion_r264079854
 
 

 ##
 File path: tests/contrib/operators/test_dingding_webhook_operator.py
 ##
 @@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import unittest
+
+from airflow import DAG, configuration
+from airflow.contrib.operators.dingding_webhook_operator import 
DingdingWebhookOperator
+from airflow.utils import timezone
+
+DEFAULT_DATE = timezone.datetime(2017, 1, 1)
+
+
+class TestDingdingWebhookOperator(unittest.TestCase):
+_config = {
+'http_conn_id': 'dingding_webhook_default',
+'webhook_token': 'manual_token',
+'message_type': 'text',
+'message': 'Airflow dingding webhook test',
+'at_mobiles': ['123', '456'],
+'at_all': False
+}
+
+def setUp(self):
+configuration.load_test_config()
+args = {
+'owner': 'airflow',
+'start_date': DEFAULT_DATE
+}
+self.dag = DAG('test_dag_id', default_args=args)
+
+def test_execute(self):
 
 Review comment:
   I do that because many of operator check just check constructor, like 
`test_slack_webhook_operator.py` and `test_spark_jdbc_operator.py`, I think 
they do that due to operator is quick simple, and all the test could check in 
hook?
   what do you think?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on a change in pull request #4779: [AIRFLOW-3958] Support list tasks as upstream in chain

2019-03-10 Thread GitBox
mik-laj commented on a change in pull request #4779: [AIRFLOW-3958] Support 
list tasks as upstream in chain
URL: https://github.com/apache/airflow/pull/4779#discussion_r264079684
 
 

 ##
 File path: airflow/utils/helpers.py
 ##
 @@ -154,19 +154,32 @@ def as_flattened_list(iterable):
 
 
 def chain(*tasks):
-"""
-Given a number of tasks, builds a dependency chain.
+r"""
+Given a number of tasks or list of tasks, builds a dependency chain.
 
-chain(task_1, task_2, task_3, task_4)
+chain(task_1, [task_2, task_3], task_4, task_5)
 
 is equivalent to
 
+   / --> task_2 \
+task_1   --> task_4 --> task_5
+   \ --> task_3 /
+
 task_1.set_downstream(task_2)
-task_2.set_downstream(task_3)
+task_1.set_downstream(task_3)
+task_2.set_downstream(task_4)
 task_3.set_downstream(task_4)
+task_4.set_downstream(task_5)
+
+:param tasks: tasks or list of tasks
+:type tasks: airflow.models.BaseOperator
 """
 for up_task, down_task in zip(tasks[:-1], tasks[1:]):
-up_task.set_downstream(down_task)
+if isinstance(up_task, list):
 
 Review comment:
   Is this necessary? According to the documentation for the `set_downstream` 
method, the parameter can be both one task and a task list.
   
http://airflow.apache.org/code.html#airflow.models.BaseOperator.set_downstream
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on a change in pull request #4779: [AIRFLOW-3958] Support list tasks as upstream in chain

2019-03-10 Thread GitBox
mik-laj commented on a change in pull request #4779: [AIRFLOW-3958] Support 
list tasks as upstream in chain
URL: https://github.com/apache/airflow/pull/4779#discussion_r264079684
 
 

 ##
 File path: airflow/utils/helpers.py
 ##
 @@ -154,19 +154,32 @@ def as_flattened_list(iterable):
 
 
 def chain(*tasks):
-"""
-Given a number of tasks, builds a dependency chain.
+r"""
+Given a number of tasks or list of tasks, builds a dependency chain.
 
-chain(task_1, task_2, task_3, task_4)
+chain(task_1, [task_2, task_3], task_4, task_5)
 
 is equivalent to
 
+   / --> task_2 \
+task_1   --> task_4 --> task_5
+   \ --> task_3 /
+
 task_1.set_downstream(task_2)
-task_2.set_downstream(task_3)
+task_1.set_downstream(task_3)
+task_2.set_downstream(task_4)
 task_3.set_downstream(task_4)
+task_4.set_downstream(task_5)
+
+:param tasks: tasks or list of tasks
+:type tasks: airflow.models.BaseOperator
 """
 for up_task, down_task in zip(tasks[:-1], tasks[1:]):
-up_task.set_downstream(down_task)
+if isinstance(up_task, list):
 
 Review comment:
   Is this necessary? According to the documentation for the `set_downstream` 
method, the parameter can be both one task and a task list.
   
http://airflow.apache.org/code.html#airflow.models.BaseOperator.set_downstream
   
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] XD-DENG commented on issue #4896: [AIRFLOW-4061] Remove incubator in CI process

2019-03-10 Thread GitBox
XD-DENG commented on issue #4896: [AIRFLOW-4061] Remove incubator in CI process
URL: https://github.com/apache/airflow/pull/4896#issuecomment-471387376
 
 
   Sorry missed your description above @zhongjiajie . Yes, change must be made 
for `airflow-ci` image on DockerHub accordingly before this PR can be merged.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on a change in pull request #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj commented on a change in pull request #4895: [AIRFLOW-1526] Add 
dingding hook and operator
URL: https://github.com/apache/airflow/pull/4895#discussion_r264079111
 
 

 ##
 File path: tests/contrib/operators/test_dingding_webhook_operator.py
 ##
 @@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import unittest
+
+from airflow import DAG, configuration
+from airflow.contrib.operators.dingding_webhook_operator import 
DingdingWebhookOperator
+from airflow.utils import timezone
+
+DEFAULT_DATE = timezone.datetime(2017, 1, 1)
+
+
+class TestDingdingWebhookOperator(unittest.TestCase):
+_config = {
+'http_conn_id': 'dingding_webhook_default',
+'webhook_token': 'manual_token',
+'message_type': 'text',
+'message': 'Airflow dingding webhook test',
+'at_mobiles': ['123', '456'],
+'at_all': False
+}
+
+def setUp(self):
+configuration.load_test_config()
+args = {
+'owner': 'airflow',
+'start_date': DEFAULT_DATE
+}
+self.dag = DAG('test_dag_id', default_args=args)
+
+def test_execute(self):
 
 Review comment:
   This test only checks the constructor. The execute method is not called.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471386977
 
 
   @mik-laj This PR have to way to pass token, One is pass token by `Operator`, 
another is set it in `dingding_webhook_default` connection.
   Second way have no safe problem, allow pass to operator just provide other 
way to send message.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (AIRFLOW-4061) Remove incubator in ci docker-compose

2019-03-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-4061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789109#comment-16789109
 ] 

ASF GitHub Bot commented on AIRFLOW-4061:
-

zhongjiajie commented on pull request #4896: [AIRFLOW-4061] Remove incubator in 
CI process
URL: https://github.com/apache/airflow/pull/4896
 
 
   Remove incubator as Airflow is Top-Level project.
   [ci skip]
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
 - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-4061\], code changes always need a Jira issue.
 - In case you are proposing a fundamental code change, you need to create 
an Airflow Improvement 
Proposal([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)).
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   
   We still use `airflowci/incubator-airflow-ci:latest` in our ci 
docker-compose, should change it to `airflowci/airflow-ci:latest`, in this case 
we have to change [airflow-ci](https://github.com/apache/airflow-ci) setting in 
[docker-hub](https://hub.docker.com/r/airflowci/incubator-airflow-ci/), let 
`airflowci/airflow-ci:latest` work.
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Remove incubator in ci docker-compose
> -
>
> Key: AIRFLOW-4061
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4061
> Project: Apache Airflow
>  Issue Type: Improvement
>  Components: ci
>Affects Versions: 1.10.2
>Reporter: zhongjiajie
>Assignee: zhongjiajie
>Priority: Minor
>  Labels: CI
> Fix For: 1.10.3
>
>
> We still use `airflowci/incubator-airflow-ci:latest` in our ci 
> docker-compose, should change it to `airflowci/airflow-ci:latest`, in this 
> case we have to change the setting for 
> [airflow-ci|https://github.com/apache/airflow-ci] docker-hub setting.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] mik-laj edited a comment on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4755: [AIRFLOW-3939] Add Google Cloud 
Translate operator
URL: https://github.com/apache/airflow/pull/4755#issuecomment-471377411
 
 
   @zhongjiajie This conflict is caused by my change - 
https://github.com/apache/airflow/pull/4814
   
   Now it is not advisable to update this PR for two reasons. First, further 
changes may occur, because we're working on the documentation structure all the 
time (ex. https://github.com/apache/airflow/pull/4894). They only expand the 
scope of documentation. If the current documentation is sufficient, future 
versions also. Secondly, this change can not be accepted, because commiter is 
on vacation. There is only one person who can accept these changes. If he comes 
back from holidays, we will pass him other changes that were made first.
   
   I hope to understand and accept our way of working. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] XD-DENG commented on issue #4896: [AIRFLOW-4061] Remove incubator in CI process

2019-03-10 Thread GitBox
XD-DENG commented on issue #4896: [AIRFLOW-4061] Remove incubator in CI process
URL: https://github.com/apache/airflow/pull/4896#issuecomment-471386249
 
 
   This PR can't be merged as `airflowci/airflow-ci:latest` is not available 
(yet).
   
   Ref: https://hub.docker.com/search?q=airflowci=image


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4896: [AIRFLOW-4061] Remove incubator in CI process

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4896: [AIRFLOW-4061] Remove incubator in CI 
process
URL: https://github.com/apache/airflow/pull/4896#issuecomment-471385785
 
 
   PTAL @ashb @kaxil @XD-DENG 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on a change in pull request #4891: Telegram hook/operator to post messages to telegram channels

2019-03-10 Thread GitBox
mik-laj commented on a change in pull request #4891: Telegram hook/operator to 
post messages to telegram channels
URL: https://github.com/apache/airflow/pull/4891#discussion_r264078091
 
 

 ##
 File path: airflow/contrib/operators/telegram_operator.py
 ##
 @@ -0,0 +1,89 @@
+import json
+import telegram
+
+from airflow.models import BaseOperator
+from airflow.utils.decorators import apply_defaults
+from airflow.exceptions import AirflowException
+from hooks.telegram_hook import TelegramHook
+
+
+class TelegramAPIOperator(BaseOperator):
+"""
+Base Telegram Operator
+The TelegramAPIPostOperator is derived from this operator.
+In the future additional Telegram bot API Operators will be derived from 
this class as well
+:param telegram_conn_id: Telegram connection ID which its password is 
Telegram API token
+:type telegram_conn_id: str
+:param token: Telergram bot API token
+:type token: str
+"""
+
+@apply_defaults
+def __init__(self, telegram_conn_id=None, token=None, *args, **kwargs):
 
 Review comment:
   Related discussion: 
https://github.com/apache/airflow/pull/4895#issuecomment-471385356


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie opened a new pull request #4896: [AIRFLOW-4061] Remove incubator in CI process

2019-03-10 Thread GitBox
zhongjiajie opened a new pull request #4896: [AIRFLOW-4061] Remove incubator in 
CI process
URL: https://github.com/apache/airflow/pull/4896
 
 
   Remove incubator as Airflow is Top-Level project.
   [ci skip]
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
 - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-4061\], code changes always need a Jira issue.
 - In case you are proposing a fundamental code change, you need to create 
an Airflow Improvement 
Proposal([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)).
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   
   We still use `airflowci/incubator-airflow-ci:latest` in our ci 
docker-compose, should change it to `airflowci/airflow-ci:latest`, in this case 
we have to change [airflow-ci](https://github.com/apache/airflow-ci) setting in 
[docker-hub](https://hub.docker.com/r/airflowci/incubator-airflow-ci/), let 
`airflowci/airflow-ci:latest` work.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4895: [AIRFLOW-1526] Add dingding hook and 
operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471385356
 
 
   Do you think it is a good idea to allow tokens to be passed as an operator 
parameter? For me it is not safe. 
   First, operator parameters are not stored securely. Connection use a fernet 
   Reference: 
https://airflow.readthedocs.io/en/latest/howto/secure-connections.html#rotating-encryption-keys
   Second: operators parameters is available in UI. This extends the group of 
people who have access to the token.
   ![0 0 0 0_8009_task_execution_date=2019-03-09T00%3A00%3A00%2B00%3A00 
dag_id=example_bash_operator 
task_id=runme_0](https://user-images.githubusercontent.com/12058428/54097115-f37df700-43ae-11e9-98f1-2f2cac159fcd.png)
   
   Similar comment from today: 
https://github.com/apache/airflow/pull/4891/files#r264048383
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
mik-laj commented on issue #4895: [AIRFLOW-1526] Add dingding hook and operator
URL: https://github.com/apache/airflow/pull/4895#issuecomment-471385356
 
 
   Do you think it is a good idea to allow tokens to be passed as an operator 
parameter? For me it is not safe. 
   First, operator parameters are not stored securely. Connection use a fernet 
   Reference: 
https://airflow.readthedocs.io/en/latest/howto/secure-connections.html#rotating-encryption-keys
   Second: operators parameters is available in UI.
   ![0 0 0 0_8009_task_execution_date=2019-03-09T00%3A00%3A00%2B00%3A00 
dag_id=example_bash_operator 
task_id=runme_0](https://user-images.githubusercontent.com/12058428/54097115-f37df700-43ae-11e9-98f1-2f2cac159fcd.png)
   
   Similar comment from today: 
https://github.com/apache/airflow/pull/4891/files#r264048383
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Created] (AIRFLOW-4061) Remove incubator in ci docker-compose

2019-03-10 Thread zhongjiajie (JIRA)
zhongjiajie created AIRFLOW-4061:


 Summary: Remove incubator in ci docker-compose
 Key: AIRFLOW-4061
 URL: https://issues.apache.org/jira/browse/AIRFLOW-4061
 Project: Apache Airflow
  Issue Type: Improvement
  Components: ci
Affects Versions: 1.10.2
Reporter: zhongjiajie
Assignee: zhongjiajie
 Fix For: 1.10.3


We still use `airflowci/incubator-airflow-ci:latest` in our ci docker-compose, 
should change it to `airflowci/airflow-ci:latest`, in this case we have to 
change the setting for [airflow-ci|https://github.com/apache/airflow-ci] 
docker-hub setting.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] zhongjiajie opened a new pull request #4895: [AIRFLOW-1526] Add dingding hook and operator

2019-03-10 Thread GitBox
zhongjiajie opened a new pull request #4895: [AIRFLOW-1526] Add dingding hook 
and operator
URL: https://github.com/apache/airflow/pull/4895
 
 
   Dingding is popular team collaboration tools talk
   just like Slack. This PR is add it to master, could
   help us easy send message to Dingding.
   
   Change db.py add conn dingding_webhook_default, could
   easy configure dingding message due the host is constant
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
 - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-1526\], code changes always need a Jira issue.
 - In case you are proposing a fundamental code change, you need to create 
an Airflow Improvement 
Proposal([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)).
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   
   Add dingding (popular team collaboration tools in China) hook and operator 
to master,
   
   ### Tests
   
   - [x] My PR adds the following unit tests :
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
 1. Subject is separated from body by a blank line
 1. Subject is limited to 50 characters (not including Jira issue reference)
 1. Subject does not end with a period
 1. Subject uses the imperative mood ("add", not "adding")
 1. Body wraps at 72 characters
 1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [x] In case of new functionality, my PR adds documentation that describes 
how to use it.
 - When adding new operators/hooks/sensors, the autoclass documentation 
generation needs to be added.
 - All the public functions and the classes in the PR contain docstrings 
that explain what it does
 - If you implement backwards incompatible changes, please leave a note in 
the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so 
we can assign it to a appropriate release
   
   ### Code Quality
   
   - [x] Passes `flake8`
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (AIRFLOW-1526) Add dingding opeartor

2019-03-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-1526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789102#comment-16789102
 ] 

ASF GitHub Bot commented on AIRFLOW-1526:
-

zhongjiajie commented on pull request #4895: [AIRFLOW-1526] Add dingding hook 
and operator
URL: https://github.com/apache/airflow/pull/4895
 
 
   Dingding is popular team collaboration tools talk
   just like Slack. This PR is add it to master, could
   help us easy send message to Dingding.
   
   Change db.py add conn dingding_webhook_default, could
   easy configure dingding message due the host is constant
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
 - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-1526\], code changes always need a Jira issue.
 - In case you are proposing a fundamental code change, you need to create 
an Airflow Improvement 
Proposal([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)).
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   
   Add dingding (popular team collaboration tools in China) hook and operator 
to master,
   
   ### Tests
   
   - [x] My PR adds the following unit tests :
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
 1. Subject is separated from body by a blank line
 1. Subject is limited to 50 characters (not including Jira issue reference)
 1. Subject does not end with a period
 1. Subject uses the imperative mood ("add", not "adding")
 1. Body wraps at 72 characters
 1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [x] In case of new functionality, my PR adds documentation that describes 
how to use it.
 - When adding new operators/hooks/sensors, the autoclass documentation 
generation needs to be added.
 - All the public functions and the classes in the PR contain docstrings 
that explain what it does
 - If you implement backwards incompatible changes, please leave a note in 
the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so 
we can assign it to a appropriate release
   
   ### Code Quality
   
   - [x] Passes `flake8`
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add dingding opeartor
> -
>
> Key: AIRFLOW-1526
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1526
> Project: Apache Airflow
>  Issue Type: New Feature
>  Components: operators
>Affects Versions: 1.8.0
>Reporter: cocopc
>Assignee: zhongjiajie
>Priority: Major
>  Labels: features
>
> h4. This operator implements send message to 
> dingding(https://www.dingtalk.com/),like slack.
> h5. usage scenario example:
> * on task fail, send message to dingding group,rather than  email.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] mik-laj commented on issue #4823: [AIRFLOW-3999] Remove all inline style

2019-03-10 Thread GitBox
mik-laj commented on issue #4823: [AIRFLOW-3999] Remove all inline style
URL: https://github.com/apache/airflow/pull/4823#issuecomment-471383048
 
 
   @ashb I updated a PR.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] XD-DENG commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor

2019-03-10 Thread GitBox
XD-DENG commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor
URL: https://github.com/apache/airflow/pull/4887#issuecomment-471382848
 
 
   @mans2singh Message passing is another question I have: currently you check 
if the message arrives, if yes, you will remove it from the queue. The way in 
which you pass the msg is XCom. I'm not sure if this is the most convenient way 
for any following operations.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate operator

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate 
operator
URL: https://github.com/apache/airflow/pull/4755#issuecomment-471381863
 
 
   @mik-laj Get it


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4755: [AIRFLOW-3939] Add Google Cloud 
Translate operator
URL: https://github.com/apache/airflow/pull/4755#issuecomment-471377411
 
 
   @zhongjiajie The conflict is caused by my change - 
https://github.com/apache/airflow/pull/4814
   
   Now it is not advisable to update this PR for two reasons. First, further 
changes may occur, because we're working on the documentation structure all the 
time (ex. https://github.com/apache/airflow/pull/4894). They only expand the 
scope of documentation. If the current documentation is sufficient, future 
versions also. Secondly, this change can not be accepted, because commiter is 
on vacation. There is only one person who can accept these changes. If he comes 
back from holidays, we will pass him other changes that were made first.
   
   I hope to understand and accept our way of working. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4755: [AIRFLOW-3939] Add Google Cloud 
Translate operator
URL: https://github.com/apache/airflow/pull/4755#issuecomment-471377411
 
 
   @zhongjiajie The conflict is caused by my change - 
https://github.com/apache/airflow/pull/4814
   
   Now it is not advisable to update this PR for two reasons. First, further 
changes may occur, because we're working on the documentation structure all the 
time (ex. https://github.com/apache/airflow/pull/4894). They only expand the 
scope of documentation and if the current documentation is sufficient, future 
versions also. Secondly, this change can not be accepted, because commiter is 
on vacation. There is only one person who can accept these changes. If he comes 
back from holidays, we will pass him other changes that were made first.
   
   I hope to understand and accept our way of working. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate operator

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4755: [AIRFLOW-3939] Add Google Cloud 
Translate operator
URL: https://github.com/apache/airflow/pull/4755#issuecomment-471377411
 
 
   @zhongjiajie The conflict is caused by my change - 
https://github.com/apache/airflow/pull/4814
   
   Now it is not advisable to update this PR for two reasons. First, further 
changes may occur, because we're working on the documentation structure all the 
time (ex. https://github.com/apache/airflow/pull/4894). Secondly, this change 
can not be accepted, because commiter is on vacation. There is only one person 
who can accept these changes. If he comes back from holidays, we will pass him 
other changes that were made first.
   
   I hope to understand and accept our way of working. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj commented on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate operator

2019-03-10 Thread GitBox
mik-laj commented on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate 
operator
URL: https://github.com/apache/airflow/pull/4755#issuecomment-471377411
 
 
   @zhongjiajie The conflict is caused by my change - 
https://github.com/apache/airflow/pull/4814
   
   Now it is not advisable to update this PR for two reasons. First, further 
changes may occur, because we're working on the documentation structure all the 
time (ex. https://github.com/apache/airflow/pull/4894). Secondly, this change 
can not be accepted, because the commiter is on vacation. There is only one 
person who can accept these changes. If he comes back from holidays, we will 
pass him other changes that were made first.
   
   I hope to understand and accept our way of working. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4779: [AIRFLOW-3958] Support list tasks as upstream in chain

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4779: [AIRFLOW-3958] Support list tasks as 
upstream in chain
URL: https://github.com/apache/airflow/pull/4779#issuecomment-471376623
 
 
   cc @XD-DENG @ashb 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mans2singh commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor

2019-03-10 Thread GitBox
mans2singh commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor
URL: https://github.com/apache/airflow/pull/4887#issuecomment-471375942
 
 
   Hi @XD-DENG - My thought was to keep it simple and make sensor just get the 
messages and pass it to the next operator.  But let me know your thought on how 
it can be improved.  Thanks


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (AIRFLOW-2061) Remove expensive redundant async.state calls in celery executor

2019-03-10 Thread Xiaodong DENG (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-2061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789084#comment-16789084
 ] 

Xiaodong DENG commented on AIRFLOW-2061:


[~jackjack10] I can't see relationship between 
[https://github.com/apache/airflow/pull/3773] and this ticket at my first glance

> Remove expensive redundant async.state calls in celery executor
> ---
>
> Key: AIRFLOW-2061
> URL: https://issues.apache.org/jira/browse/AIRFLOW-2061
> Project: Apache Airflow
>  Issue Type: Improvement
>  Components: executor
>Reporter: Dan Davydov
>Assignee: Dan Davydov
>Priority: Major
>
> The Celery Executor makes the expense calls async.state multiple times, when 
> it could reuse the initial async.state call.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] zhongjiajie edited a comment on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate operator

2019-03-10 Thread GitBox
zhongjiajie edited a comment on issue #4755: [AIRFLOW-3939] Add Google Cloud 
Translate operator
URL: https://github.com/apache/airflow/pull/4755#issuecomment-471374681
 
 
   @potiuk The `docs` are change, maybe you should rebase on master.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] zhongjiajie commented on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate operator

2019-03-10 Thread GitBox
zhongjiajie commented on issue #4755: [AIRFLOW-3939] Add Google Cloud Translate 
operator
URL: https://github.com/apache/airflow/pull/4755#issuecomment-471374681
 
 
   @potiuk The docs are change, maybe you should rebase on master.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Assigned] (AIRFLOW-1526) Add dingding opeartor

2019-03-10 Thread zhongjiajie (JIRA)


 [ 
https://issues.apache.org/jira/browse/AIRFLOW-1526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhongjiajie reassigned AIRFLOW-1526:


Assignee: zhongjiajie

> Add dingding opeartor
> -
>
> Key: AIRFLOW-1526
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1526
> Project: Apache Airflow
>  Issue Type: New Feature
>  Components: operators
>Affects Versions: 1.8.0
>Reporter: cocopc
>Assignee: zhongjiajie
>Priority: Major
>  Labels: features
>
> h4. This operator implements send message to 
> dingding(https://www.dingtalk.com/),like slack.
> h5. usage scenario example:
> * on task fail, send message to dingding group,rather than  email.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] XD-DENG commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor

2019-03-10 Thread GitBox
XD-DENG commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor
URL: https://github.com/apache/airflow/pull/4887#issuecomment-471372376
 
 
   Hi @mans2singh Seems this sensor only checks whether there is message in the 
queue, or not.
   
   Do you think adding feature to check if specific body contents is in the 
queue would be a good idea?


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (AIRFLOW-4046) Validate poke_interval and timeout value in Airflow Sensor

2019-03-10 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-4046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789073#comment-16789073
 ] 

ASF subversion and git services commented on AIRFLOW-4046:
--

Commit ffb025997c1b70ab773fa08cbc70f222e7c69487 in airflow's branch 
refs/heads/master from kani5hk
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=ffb0259 ]

[AIRFLOW-4046] Add validations for poke_interval & timeout for Sensor (#4878)



> Validate poke_interval and timeout value in Airflow Sensor
> --
>
> Key: AIRFLOW-4046
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4046
> Project: Apache Airflow
>  Issue Type: Improvement
>  Components: operators
>Affects Versions: 1.10.2
>Reporter: Kanishk Lohumi
>Assignee: Kanishk Lohumi
>Priority: Major
>
> There is no validation being done on poke_interval & timeout values provided 
> to BaseSensor, this results in ValueError with negative value of 
> poke_interval when mode is *poke* because  time.sleep() doesn't support 
> negative values and give below error. {{}}
> {noformat}
> [2019-03-07 11:48:08,182] {models.py:1790} ERROR - sleep length must be 
> non-negative:cG9rZS1rYW5pc2hrcy1tYnAuY29ycC5hZG9iZS5jb20= Traceback (most 
> recent call last): File 
> "/Users/lohumi/Documents/airflow_1.10.2/lib/python3.6/site-packages/airflow/models.py",
>  line 1659, in _run_raw_task result = task_copy.execute(context=context) File 
> "/Users/lohumi/Documents/airflow_1.10.2/lib/python3.6/site-packages/airflow/sensors/base_sensor_operator.py",
>  line 112, in execute sleep(self.poke_interval) ValueError: sleep length must 
> be non-negative{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] XD-DENG commented on issue #4878: [AIRFLOW-4046] Added validations for poke_interval & timeout for Airflow Sensor

2019-03-10 Thread GitBox
XD-DENG commented on issue #4878: [AIRFLOW-4046] Added validations for 
poke_interval & timeout for Airflow Sensor
URL: https://github.com/apache/airflow/pull/4878#issuecomment-471370858
 
 
   Here we go! Thanks for the contribution @kani5hk 


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (AIRFLOW-4046) Validate poke_interval and timeout value in Airflow Sensor

2019-03-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-4046?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789072#comment-16789072
 ] 

ASF GitHub Bot commented on AIRFLOW-4046:
-

XD-DENG commented on pull request #4878: [AIRFLOW-4046] Added validations for 
poke_interval & timeout for Airflow Sensor
URL: https://github.com/apache/airflow/pull/4878
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Validate poke_interval and timeout value in Airflow Sensor
> --
>
> Key: AIRFLOW-4046
> URL: https://issues.apache.org/jira/browse/AIRFLOW-4046
> Project: Apache Airflow
>  Issue Type: Improvement
>  Components: operators
>Affects Versions: 1.10.2
>Reporter: Kanishk Lohumi
>Assignee: Kanishk Lohumi
>Priority: Major
>
> There is no validation being done on poke_interval & timeout values provided 
> to BaseSensor, this results in ValueError with negative value of 
> poke_interval when mode is *poke* because  time.sleep() doesn't support 
> negative values and give below error. {{}}
> {noformat}
> [2019-03-07 11:48:08,182] {models.py:1790} ERROR - sleep length must be 
> non-negative:cG9rZS1rYW5pc2hrcy1tYnAuY29ycC5hZG9iZS5jb20= Traceback (most 
> recent call last): File 
> "/Users/lohumi/Documents/airflow_1.10.2/lib/python3.6/site-packages/airflow/models.py",
>  line 1659, in _run_raw_task result = task_copy.execute(context=context) File 
> "/Users/lohumi/Documents/airflow_1.10.2/lib/python3.6/site-packages/airflow/sensors/base_sensor_operator.py",
>  line 112, in execute sleep(self.poke_interval) ValueError: sleep length must 
> be non-negative{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] XD-DENG merged pull request #4878: [AIRFLOW-4046] Added validations for poke_interval & timeout for Airflow Sensor

2019-03-10 Thread GitBox
XD-DENG merged pull request #4878: [AIRFLOW-4046] Added validations for 
poke_interval & timeout for Airflow Sensor
URL: https://github.com/apache/airflow/pull/4878
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4784: [AIRFLOW-XXX] [WIP] Enforce order in imports

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4784: [AIRFLOW-XXX] [WIP] Enforce order in 
imports
URL: https://github.com/apache/airflow/pull/4784#issuecomment-471337252
 
 
   This PR is broken. I will create a new PR, because I can not change my 
status. I do not see the appropriate button that changes the status. 
   ![Screenshot 2019-03-10 at 20 38 
10](https://user-images.githubusercontent.com/12058428/54090453-b85ed200-4374-11e9-809c-2fe5964aaf96.png)
   
   Draft pull request is a experiment. Draft is an experiment made by Github. 
It creates more problems than it solves. Travis does not work on draft pull 
request, which makes testing difficult.  We experimented with this feature in 
the company and abandoned its use. For now, it does not work properly.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj edited a comment on issue #4784: [AIRFLOW-XXX] [WIP] Enforce order in imports

2019-03-10 Thread GitBox
mik-laj edited a comment on issue #4784: [AIRFLOW-XXX] [WIP] Enforce order in 
imports
URL: https://github.com/apache/airflow/pull/4784#issuecomment-471337252
 
 
   This PR is broken. I will create a new PR, because I can not change my 
status. I do not see the appropriate button that changes the status. 
   ![Screenshot 2019-03-10 at 20 38 
10](https://user-images.githubusercontent.com/12058428/54090453-b85ed200-4374-11e9-809c-2fe5964aaf96.png)
   
   Draft is an experiment made by Github. It creates more problems than it 
solves. Travis does not work on draft pull request, which makes testing 
difficult.  We experimented with this feature in the company and abandoned its 
use. For now, it does not work properly.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mans2singh commented on a change in pull request #4887: [AIRFLOW-4055] Add AWS SQS Sensor

2019-03-10 Thread GitBox
mans2singh commented on a change in pull request #4887: [AIRFLOW-4055] Add AWS 
SQS Sensor
URL: https://github.com/apache/airflow/pull/4887#discussion_r264066163
 
 

 ##
 File path: airflow/contrib/sensors/aws_sqs_sensor.py
 ##
 @@ -0,0 +1,93 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from airflow.sensors.base_sensor_operator import BaseSensorOperator
+from airflow.utils.decorators import apply_defaults
+from airflow.contrib.hooks.aws_sqs_hook import SQSHook
+from airflow.exceptions import AirflowException
+
+
+class SQSSensor(BaseSensorOperator):
+"""
+Get messages from an SQS queue and passes them through XCom.
+
+"""
+
+template_fields = ['sqs_queue', 'max_messages']
+
+@apply_defaults
+def __init__(self, aws_conn_id, sqs_queue, max_messages=5, *args, 
**kwargs):
+"""
+:param aws_conn_id: AWS connection id
+:type aws_conn_id: str
+:param sqs_queue: The SQS queue
+:type sqs_queue: str
+:param max_messages: The maximum number of messages to retrieve for 
each poke
+:type max_messages: int
+"""
+super(SQSSensor, self).__init__(*args, **kwargs)
+self.sqs_queue = sqs_queue
+self.aws_conn_id = aws_conn_id
+self.max_messages = max_messages
+self.sqs_hook = SQSHook(aws_conn_id=self.aws_conn_id)
+
+def poke(self, context):
+"""
+Check for message on subscribed queue and write to xcom the message 
with key ``messages``
+
+:param context: the context object
+:type context: dict
+:return: ``True`` if message is available or ``False``
+"""
+
+self.log.debug('SQSSensor checking for message on queue: %s', 
self.sqs_queue)
+
+try:
+messages = 
self.sqs_hook.get_conn().receive_message(QueueUrl=self.sqs_queue,
+
MaxNumberOfMessages=self.max_messages)
+
+self.log.debug("reveived message %s", str(messages))
+
+if 'Messages' not in messages:
+self.log.debug('No message received ' + str(messages))
 
 Review comment:
   @mik-laj - Thanks for your comment.  I've corrected the log statement.  Mans


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (AIRFLOW-3996) Include full source code examples in the documentation

2019-03-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/AIRFLOW-3996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16789052#comment-16789052
 ] 

ASF GitHub Bot commented on AIRFLOW-3996:
-

mik-laj commented on pull request #4894: [AIRFLOW-3996] Add view source link to 
include fragments
URL: https://github.com/apache/airflow/pull/4894
 
 
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [ ] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
 - https://issues.apache.org/jira/browse/AIRFLOW-3996
 - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-XXX\], code changes always need a Jira issue.
 - In case you are proposing a fundamental code change, you need to create 
an Airflow Improvement 
Proposal([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)).
   
   ### Description
   
   I added buttons that will allow you to go to the source code of the whole 
file with an example.
   
   Preview: http://bloody-boundary.surge.sh/howto/operator/bash.html
   
   ![Screenshot 2019-03-10 at 23 39 
46](https://user-images.githubusercontent.com/12058428/54092584-1f3cb500-438e-11e9-8f95-48164bd6bfae.png)
   
   UI component has been adapted to mobile devices.
   
   We've discussed the different look of the header internally. It did not 
include a button but a clickable filename. A vote took place and this is a 
winning proposition.
   
   Currently, it does not work for some examples for GCP operators due to 
errors in their implementation. My team is planning to improve these operators 
in the future. I also plan that other examples should also contain the full 
source code and be tested automatically - 
https://github.com/PolideaInternal/airflow/pull/77
   
   ### Tests
   
   - [ ] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   
   ### Commits
   
   - [ ] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
 1. Subject is separated from body by a blank line
 1. Subject is limited to 50 characters (not including Jira issue reference)
 1. Subject does not end with a period
 1. Subject uses the imperative mood ("add", not "adding")
 1. Body wraps at 72 characters
 1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes 
how to use it.
 - When adding new operators/hooks/sensors, the autoclass documentation 
generation needs to be added.
 - All the public functions and the classes in the PR contain docstrings 
that explain what it does
 - If you implement backwards incompatible changes, please leave a note in 
the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so 
we can assign it to a appropriate release
   
   ### Code Quality
   
   - [ ] Passes `flake8`
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Include full source code examples in the documentation
> --
>
> Key: AIRFLOW-3996
> URL: https://issues.apache.org/jira/browse/AIRFLOW-3996
> Project: Apache Airflow
>  Issue Type: Improvement
>Reporter: Kamil Bregula
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] [airflow] mik-laj commented on a change in pull request #4887: [AIRFLOW-4055] Add AWS SQS Sensor

2019-03-10 Thread GitBox
mik-laj commented on a change in pull request #4887: [AIRFLOW-4055] Add AWS SQS 
Sensor
URL: https://github.com/apache/airflow/pull/4887#discussion_r264063370
 
 

 ##
 File path: airflow/contrib/sensors/aws_sqs_sensor.py
 ##
 @@ -0,0 +1,93 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from airflow.sensors.base_sensor_operator import BaseSensorOperator
+from airflow.utils.decorators import apply_defaults
+from airflow.contrib.hooks.aws_sqs_hook import SQSHook
+from airflow.exceptions import AirflowException
+
+
+class SQSSensor(BaseSensorOperator):
+"""
+Get messages from an SQS queue and passes them through XCom.
+
+"""
+
+template_fields = ['sqs_queue', 'max_messages']
+
+@apply_defaults
+def __init__(self, aws_conn_id, sqs_queue, max_messages=5, *args, 
**kwargs):
+"""
+:param aws_conn_id: AWS connection id
+:type aws_conn_id: str
+:param sqs_queue: The SQS queue
+:type sqs_queue: str
+:param max_messages: The maximum number of messages to retrieve for 
each poke
+:type max_messages: int
+"""
+super(SQSSensor, self).__init__(*args, **kwargs)
+self.sqs_queue = sqs_queue
+self.aws_conn_id = aws_conn_id
+self.max_messages = max_messages
+self.sqs_hook = SQSHook(aws_conn_id=self.aws_conn_id)
+
+def poke(self, context):
+"""
+Check for message on subscribed queue and write to xcom the message 
with key ``messages``
+
+:param context: the context object
+:type context: dict
+:return: ``True`` if message is available or ``False``
+"""
+
+self.log.debug('SQSSensor checking for message on queue: %s', 
self.sqs_queue)
+
+try:
+messages = 
self.sqs_hook.get_conn().receive_message(QueueUrl=self.sqs_queue,
+
MaxNumberOfMessages=self.max_messages)
+
+self.log.debug("reveived message %s", str(messages))
+
+if 'Messages' not in messages:
+self.log.debug('No message received ' + str(messages))
 
 Review comment:
   ```suggestion
   self.log.debug('No message received %s', str(messages))
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mik-laj opened a new pull request #4894: [AIRFLOW-3996] Add view source link to include fragments

2019-03-10 Thread GitBox
mik-laj opened a new pull request #4894: [AIRFLOW-3996] Add view source link to 
include fragments
URL: https://github.com/apache/airflow/pull/4894
 
 
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [ ] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
 - https://issues.apache.org/jira/browse/AIRFLOW-3996
 - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-XXX\], code changes always need a Jira issue.
 - In case you are proposing a fundamental code change, you need to create 
an Airflow Improvement 
Proposal([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)).
   
   ### Description
   
   I added buttons that will allow you to go to the source code of the whole 
file with an example.
   
   Preview: http://bloody-boundary.surge.sh/howto/operator/bash.html
   
   ![Screenshot 2019-03-10 at 23 39 
46](https://user-images.githubusercontent.com/12058428/54092584-1f3cb500-438e-11e9-8f95-48164bd6bfae.png)
   
   UI component has been adapted to mobile devices.
   
   We've discussed the different look of the header internally. It did not 
include a button but a clickable filename. A vote took place and this is a 
winning proposition.
   
   Currently, it does not work for some examples for GCP operators due to 
errors in their implementation. My team is planning to improve these operators 
in the future. I also plan that other examples should also contain the full 
source code and be tested automatically - 
https://github.com/PolideaInternal/airflow/pull/77
   
   ### Tests
   
   - [ ] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   
   ### Commits
   
   - [ ] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
 1. Subject is separated from body by a blank line
 1. Subject is limited to 50 characters (not including Jira issue reference)
 1. Subject does not end with a period
 1. Subject uses the imperative mood ("add", not "adding")
 1. Body wraps at 72 characters
 1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes 
how to use it.
 - When adding new operators/hooks/sensors, the autoclass documentation 
generation needs to be added.
 - All the public functions and the classes in the PR contain docstrings 
that explain what it does
 - If you implement backwards incompatible changes, please leave a note in 
the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so 
we can assign it to a appropriate release
   
   ### Code Quality
   
   - [ ] Passes `flake8`
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] mans2singh commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor

2019-03-10 Thread GitBox
mans2singh commented on issue #4887: [AIRFLOW-4055] Add AWS SQS Sensor
URL: https://github.com/apache/airflow/pull/4887#issuecomment-471355820
 
 
   @Fokko @feng-tao @mik-laj @zhongjiajie - Let me know if you have any 
comments on this PR.  Thanks


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [airflow] codecov-io edited a comment on issue #4893: [DRAFT] [AIRFLOW-3891] Make the Graph View time-zone aware

2019-03-10 Thread GitBox
codecov-io edited a comment on issue #4893: [DRAFT] [AIRFLOW-3891] Make the 
Graph View time-zone aware
URL: https://github.com/apache/airflow/pull/4893#issuecomment-471344451
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/4893?src=pr=h1) 
Report
   > Merging 
[#4893](https://codecov.io/gh/apache/airflow/pull/4893?src=pr=desc) into 
[master](https://codecov.io/gh/apache/airflow/commit/e220ac5bcfd56f048f552f47e7e1c5813f7b928f?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/airflow/pull/4893/graphs/tree.svg?width=650=WdLKlKHOAU=150=pr)](https://codecov.io/gh/apache/airflow/pull/4893?src=pr=tree)
   
   ```diff
   @@  Coverage Diff   @@
   ##   master   #4893   +/-   ##
   ==
 Coverage75.3%   75.3%   
   ==
 Files 450 450   
 Lines   29023   29023   
   ==
 Hits21855   21855   
 Misses   71687168
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/airflow/pull/4893?src=pr=tree) | 
Coverage Δ | |
   |---|---|---|
   | 
[airflow/models/\_\_init\_\_.py](https://codecov.io/gh/apache/airflow/pull/4893/diff?src=pr=tree#diff-YWlyZmxvdy9tb2RlbHMvX19pbml0X18ucHk=)
 | `92.85% <0%> (-0.06%)` | :arrow_down: |
   | 
[airflow/contrib/operators/ssh\_operator.py](https://codecov.io/gh/apache/airflow/pull/4893/diff?src=pr=tree#diff-YWlyZmxvdy9jb250cmliL29wZXJhdG9ycy9zc2hfb3BlcmF0b3IucHk=)
 | `83.54% <0%> (+1.26%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/airflow/pull/4893?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/airflow/pull/4893?src=pr=footer). 
Last update 
[e220ac5...5fbfc7a](https://codecov.io/gh/apache/airflow/pull/4893?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


  1   2   >