You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/02/02 13:50:08 UTC

[GitHub] [airflow] pgillet opened a new pull request #14028: Reuse private_key_passphrase from SSHHook super class

pgillet opened a new pull request #14028:
URL: https://github.com/apache/airflow/pull/14028


   Some operators perform SFTP operations by the means of `SFTPHook`. `SFTPHook` delegates the actual SFTP connection to
    the `pysftp` module.
   
   When connecting with a private key protected by a passphrase, the `private_key_pass` extra parameter had to be
    specified in the connection, and this corresponds to the arguments' naming in `pysftp`.
   
   However, `SFTPHook` inherits from `SSHHook` which already manages a `private_key_passphrase` extra param. But this
    param was unused in favor of the `private_key_pass` param introduced in `SFTPHook`.
   
   For consistency, `private_key_pass` has been dropped in `SFTPHook` and `private_key_passphrase` is well reused.
   This way, a single connection can be used for both SSH and SFTP 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:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r569798765



##########
File path: UPDATING.md
##########
@@ -84,6 +84,20 @@ constantly.
 From Airflow 2.0.0, the scheduling decisions have been moved from
 DagFileProcessor to Scheduler, so we can keep the default a bit higher: `30`.
 
+### SFTP connection `private_key_pass` extra param is renamed to `private_key_passphrase`
+
+Some operators perform SFTP operations by the means of `SFTPHook`. `SFTPHook` delegates the actual SFTP connection to
+ the `pysftp` module.
+
+When connecting with a private key protected by a passphrase, the `private_key_pass` extra parameter had to be
+ specified in the connection, and this corresponds to the arguments' naming in `pysftp`.
+
+However, `SFTPHook` inherits from `SSHHook` which already manages a `private_key_passphrase` extra param. But this
+ param was unused in favor of the `private_key_pass` param introduced in `SFTPHook`.
+
+For consistency, `private_key_pass` has been dropped in `SFTPHook` and `private_key_passphrase` is well reused.
+This way, a single connection can be used for both SSH and SFTP operations.
+

Review comment:
       Correct. Those should be moved to CHANGELOG.rst (and ADDITIONAL_INFO.md for backports till the end of March) in the provider's folders. Those are newly added (just merged some changes recently and once this PR is merged (#14013) the SFTP provider will have both files that should be  modified instead. I am releasing new wave of providers today. so this change wil only male it to the next one (but I think it is not urgent and can be released easily in 2-3 weeks when we release the next wave). 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] pgillet commented on a change in pull request #14028: Depreciate private_key_pass extra param and rename to private_key_passphrase

Posted by GitBox <gi...@apache.org>.
pgillet commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r596253056



##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -131,9 +132,11 @@ def __init__(  # pylint: disable=too-many-statements
                     self.key_file = extra_options.get("key_file")
 
                 private_key = extra_options.get('private_key')
-                private_key_passphrase = extra_options.get('private_key_passphrase')
+                self.private_key_passphrase = extra_options.get('private_key_passphrase')

Review comment:
       The idea was to reuse it in SFTPHook subclass, not to change it. The private key passphrase is consumed by Paramiko in SSHhook, while it is consumed by Pysftp in SFTPHook. Anyway, I do not inherit this field anymore.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#issuecomment-773262697


   [The Workflow run](https://github.com/apache/airflow/actions/runs/536924034) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] pgillet commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
pgillet commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r570071000



##########
File path: UPDATING.md
##########
@@ -84,6 +84,20 @@ constantly.
 From Airflow 2.0.0, the scheduling decisions have been moved from
 DagFileProcessor to Scheduler, so we can keep the default a bit higher: `30`.
 
+### SFTP connection `private_key_pass` extra param is renamed to `private_key_passphrase`
+
+Some operators perform SFTP operations by the means of `SFTPHook`. `SFTPHook` delegates the actual SFTP connection to
+ the `pysftp` module.
+
+When connecting with a private key protected by a passphrase, the `private_key_pass` extra parameter had to be
+ specified in the connection, and this corresponds to the arguments' naming in `pysftp`.
+
+However, `SFTPHook` inherits from `SSHHook` which already manages a `private_key_passphrase` extra param. But this
+ param was unused in favor of the `private_key_pass` param introduced in `SFTPHook`.
+
+For consistency, `private_key_pass` has been dropped in `SFTPHook` and `private_key_passphrase` is well reused.
+This way, a single connection can be used for both SSH and SFTP operations.
+

Review comment:
       :heavy_check_mark: Done




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] pgillet commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
pgillet commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r596253056



##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -131,9 +132,11 @@ def __init__(  # pylint: disable=too-many-statements
                     self.key_file = extra_options.get("key_file")
 
                 private_key = extra_options.get('private_key')
-                private_key_passphrase = extra_options.get('private_key_passphrase')
+                self.private_key_passphrase = extra_options.get('private_key_passphrase')

Review comment:
       The idea was to use it in SFTPHook subclass, not to change 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:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #14028: Depreciate private_key_pass extra param and rename to private_key_passphrase

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#issuecomment-858808056


   Awesome work, congrats on your first merged pull request!
   


-- 
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:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#issuecomment-771647479


   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, pylint and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/master/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/master/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/master/BREEZE.rst) for testing locally, itโ€™s a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better ๐Ÿš€.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] ashb commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r589511188



##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -131,9 +132,11 @@ def __init__(  # pylint: disable=too-many-statements
                     self.key_file = extra_options.get("key_file")
 
                 private_key = extra_options.get('private_key')
-                private_key_passphrase = extra_options.get('private_key_passphrase')
+                self.private_key_passphrase = extra_options.get('private_key_passphrase')

Review comment:
       Making this an instance variable has no effect -- changing it won't do anything as the value has already been used by the time anything else could set this.

##########
File path: airflow/providers/sftp/hooks/sftp.py
##########
@@ -76,8 +75,6 @@ def __init__(self, ftp_conn_id: str = 'sftp_default', *args, **kwargs) -> None:
             conn = self.get_connection(self.ssh_conn_id)
             if conn.extra is not None:
                 extra_options = conn.extra_dejson
-                if 'private_key_pass' in extra_options:
-                    self.private_key_pass = extra_options.get('private_key_pass')

Review comment:
       This makes this PR a breaking change -- could you please add a back-compatiblity path in (i.e. something that notices when this option is set but the new one is not, uses it and issues a deprecation warning)?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] pgillet commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
pgillet commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r584920765



##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -131,9 +132,9 @@ def __init__(  # pylint: disable=too-many-statements
                     self.key_file = extra_options.get("key_file")
 
                 private_key = extra_options.get('private_key')
-                private_key_passphrase = extra_options.get('private_key_passphrase')
+                self.private_key_passphrase = extra_options.get('private_key_passphrase')
                 if private_key:
-                    self.pkey = self._pkey_from_private_key(private_key, passphrase=private_key_passphrase)
+                    self.pkey = self._pkey_from_private_key(private_key, passphrase=self.private_key_passphrase)

Review comment:
       :heavy_check_mark: Done




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] alexInhert commented on a change in pull request #14028: Depreciate private_key_pass extra param and rename to private_key_passphrase

Posted by GitBox <gi...@apache.org>.
alexInhert commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r635825603



##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -131,9 +132,11 @@ def __init__(  # pylint: disable=too-many-statements
                     self.key_file = extra_options.get("key_file")
 
                 private_key = extra_options.get('private_key')
-                private_key_passphrase = extra_options.get('private_key_passphrase')
+                self.private_key_passphrase = extra_options.get('private_key_passphrase')

Review comment:
       hi @pgillet @ashb will this PR be released in the next provider batch?




-- 
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:
users@infra.apache.org



[GitHub] [airflow] ashb commented on a change in pull request #14028: Depreciate private_key_pass extra param and rename to private_key_passphrase

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r596271017



##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -131,9 +132,11 @@ def __init__(  # pylint: disable=too-many-statements
                     self.key_file = extra_options.get("key_file")
 
                 private_key = extra_options.get('private_key')
-                private_key_passphrase = extra_options.get('private_key_passphrase')
+                self.private_key_passphrase = extra_options.get('private_key_passphrase')

Review comment:
       Ah gotcha




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] pgillet commented on a change in pull request #14028: Depreciate private_key_pass extra param and rename to private_key_passphrase

Posted by GitBox <gi...@apache.org>.
pgillet commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r596253056



##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -131,9 +132,11 @@ def __init__(  # pylint: disable=too-many-statements
                     self.key_file = extra_options.get("key_file")
 
                 private_key = extra_options.get('private_key')
-                private_key_passphrase = extra_options.get('private_key_passphrase')
+                self.private_key_passphrase = extra_options.get('private_key_passphrase')

Review comment:
       The idea was to reuse it in SFTPHook subclass, not to change it. The private key passphrase is consumed by Paramiko in SSHhook, while it is consumed by Pysftp in SFTPHook.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] pgillet commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
pgillet commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r571955484



##########
File path: UPDATING.md
##########
@@ -84,6 +84,20 @@ constantly.
 From Airflow 2.0.0, the scheduling decisions have been moved from
 DagFileProcessor to Scheduler, so we can keep the default a bit higher: `30`.
 
+### SFTP connection `private_key_pass` extra param is renamed to `private_key_passphrase`
+
+Some operators perform SFTP operations by the means of `SFTPHook`. `SFTPHook` delegates the actual SFTP connection to
+ the `pysftp` module.
+
+When connecting with a private key protected by a passphrase, the `private_key_pass` extra parameter had to be
+ specified in the connection, and this corresponds to the arguments' naming in `pysftp`.
+
+However, `SFTPHook` inherits from `SSHHook` which already manages a `private_key_passphrase` extra param. But this
+ param was unused in favor of the `private_key_pass` param introduced in `SFTPHook`.
+
+For consistency, `private_key_pass` has been dropped in `SFTPHook` and `private_key_passphrase` is well reused.
+This way, a single connection can be used for both SSH and SFTP operations.
+

Review comment:
       Hi,
   I don't know if it's my job to resolve the conversation !?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] RosterIn commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
RosterIn commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r569793682



##########
File path: UPDATING.md
##########
@@ -84,6 +84,20 @@ constantly.
 From Airflow 2.0.0, the scheduling decisions have been moved from
 DagFileProcessor to Scheduler, so we can keep the default a bit higher: `30`.
 
+### SFTP connection `private_key_pass` extra param is renamed to `private_key_passphrase`
+
+Some operators perform SFTP operations by the means of `SFTPHook`. `SFTPHook` delegates the actual SFTP connection to
+ the `pysftp` module.
+
+When connecting with a private key protected by a passphrase, the `private_key_pass` extra parameter had to be
+ specified in the connection, and this corresponds to the arguments' naming in `pysftp`.
+
+However, `SFTPHook` inherits from `SSHHook` which already manages a `private_key_passphrase` extra param. But this
+ param was unused in favor of the `private_key_pass` param introduced in `SFTPHook`.
+
+For consistency, `private_key_pass` has been dropped in `SFTPHook` and `private_key_passphrase` is well reused.
+This way, a single connection can be used for both SSH and SFTP operations.
+

Review comment:
       I don't think this is the place for this.
   It's information about the backward incompatibility of a provider. 
   If I upgrade a provider I need to see this in the provider release notes not in Airflow release notes.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] ashb merged pull request #14028: Depreciate private_key_pass extra param and rename to private_key_passphrase

Posted by GitBox <gi...@apache.org>.
ashb merged pull request #14028:
URL: https://github.com/apache/airflow/pull/14028


   


-- 
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:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #14028: Depreciate private_key_pass extra param and rename to private_key_passphrase

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#issuecomment-858782384


   The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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:
users@infra.apache.org



[GitHub] [airflow] pgillet commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
pgillet commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r570071000



##########
File path: UPDATING.md
##########
@@ -84,6 +84,20 @@ constantly.
 From Airflow 2.0.0, the scheduling decisions have been moved from
 DagFileProcessor to Scheduler, so we can keep the default a bit higher: `30`.
 
+### SFTP connection `private_key_pass` extra param is renamed to `private_key_passphrase`
+
+Some operators perform SFTP operations by the means of `SFTPHook`. `SFTPHook` delegates the actual SFTP connection to
+ the `pysftp` module.
+
+When connecting with a private key protected by a passphrase, the `private_key_pass` extra parameter had to be
+ specified in the connection, and this corresponds to the arguments' naming in `pysftp`.
+
+However, `SFTPHook` inherits from `SSHHook` which already manages a `private_key_passphrase` extra param. But this
+ param was unused in favor of the `private_key_pass` param introduced in `SFTPHook`.
+
+For consistency, `private_key_pass` has been dropped in `SFTPHook` and `private_key_passphrase` is well reused.
+This way, a single connection can be used for both SSH and SFTP operations.
+

Review comment:
       :heavy_check_mark: Done




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] pgillet commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
pgillet commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r596250372



##########
File path: airflow/providers/sftp/hooks/sftp.py
##########
@@ -76,8 +75,6 @@ def __init__(self, ftp_conn_id: str = 'sftp_default', *args, **kwargs) -> None:
             conn = self.get_connection(self.ssh_conn_id)
             if conn.extra is not None:
                 extra_options = conn.extra_dejson
-                if 'private_key_pass' in extra_options:
-                    self.private_key_pass = extra_options.get('private_key_pass')

Review comment:
       :heavy_check_mark:  Done




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#issuecomment-773262697


   [The Workflow run](https://github.com/apache/airflow/actions/runs/536924034) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r569798765



##########
File path: UPDATING.md
##########
@@ -84,6 +84,20 @@ constantly.
 From Airflow 2.0.0, the scheduling decisions have been moved from
 DagFileProcessor to Scheduler, so we can keep the default a bit higher: `30`.
 
+### SFTP connection `private_key_pass` extra param is renamed to `private_key_passphrase`
+
+Some operators perform SFTP operations by the means of `SFTPHook`. `SFTPHook` delegates the actual SFTP connection to
+ the `pysftp` module.
+
+When connecting with a private key protected by a passphrase, the `private_key_pass` extra parameter had to be
+ specified in the connection, and this corresponds to the arguments' naming in `pysftp`.
+
+However, `SFTPHook` inherits from `SSHHook` which already manages a `private_key_passphrase` extra param. But this
+ param was unused in favor of the `private_key_pass` param introduced in `SFTPHook`.
+
+For consistency, `private_key_pass` has been dropped in `SFTPHook` and `private_key_passphrase` is well reused.
+This way, a single connection can be used for both SSH and SFTP operations.
+

Review comment:
       Correct. Those should be moved to CHANGELOG.rst (and ADDITIONAL_INFO.md for backports till the end of March). Those are newly added (just merged some changes recently and once this PR is merged (#14013) the SFTP provider will have both files that should be  modified instead. I am releasing new wave of providers today. so this change wil only male it to the next one (but I think it is not urgent and can be released easily in 2-3 weeks when we release the next wave). 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] RosterIn commented on a change in pull request #14028: Reuse private_key_passphrase from SSHHook super class

Posted by GitBox <gi...@apache.org>.
RosterIn commented on a change in pull request #14028:
URL: https://github.com/apache/airflow/pull/14028#discussion_r584360235



##########
File path: airflow/providers/ssh/hooks/ssh.py
##########
@@ -131,9 +132,9 @@ def __init__(  # pylint: disable=too-many-statements
                     self.key_file = extra_options.get("key_file")
 
                 private_key = extra_options.get('private_key')
-                private_key_passphrase = extra_options.get('private_key_passphrase')
+                self.private_key_passphrase = extra_options.get('private_key_passphrase')
                 if private_key:
-                    self.pkey = self._pkey_from_private_key(private_key, passphrase=private_key_passphrase)
+                    self.pkey = self._pkey_from_private_key(private_key, passphrase=self.private_key_passphrase)

Review comment:
       ```suggestion
                       self.pkey = self._pkey_from_private_key(
                           private_key, passphrase=self.private_key_passphrase
                       )
   ```
   to make pylint happy




----------------------------------------------------------------
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:
users@infra.apache.org