From commits-return-19048-archive-asf-public=cust-asf.ponee.io@airflow.incubator.apache.org Fri Aug 24 01:47:59 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 771E4180677 for ; Fri, 24 Aug 2018 01:47:59 +0200 (CEST) Received: (qmail 24549 invoked by uid 500); 23 Aug 2018 23:47:58 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 24540 invoked by uid 99); 23 Aug 2018 23:47:58 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Aug 2018 23:47:58 +0000 From: GitBox To: commits@airflow.apache.org Subject: [GitHub] XD-DENG commented on a change in pull request #3793: [AIRFLOW-2948] Arg check & better doc - SSHOperator & SFTPOperator Message-ID: <153506807804.31709.5239657666162273749.gitbox@gitbox.apache.org> Date: Thu, 23 Aug 2018 23:47:58 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit XD-DENG commented on a change in pull request #3793: [AIRFLOW-2948] Arg check & better doc - SSHOperator & SFTPOperator URL: https://github.com/apache/incubator-airflow/pull/3793#discussion_r212488849 ########## File path: airflow/contrib/operators/sftp_operator.py ########## @@ -77,13 +81,19 @@ def __init__(self, def execute(self, context): file_msg = None try: - if self.ssh_conn_id and not self.ssh_hook: - self.ssh_hook = SSHHook(ssh_conn_id=self.ssh_conn_id) + if self.ssh_conn_id: + if self.ssh_hook: + self.log.info("ssh_conn_id is ignored when ssh_hook is provided.") + else: + self.ssh_hook = SSHHook(ssh_conn_id=self.ssh_conn_id) Review comment: I have noticed this as well. I'm following the existing implementation. `timeout` was added for `SSHOperator` in PR https://github.com/apache/incubator-airflow/pull/3666 . I'm not sure if there is any good reason for which `timeout` was added for `SSHOperator` but not added for the `SSHHook` in `SFTPOperator`. Giving I'm not confident about the reason behind, I don't intend to make change on this in this PR as well. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services