apache-airflow-providers-sftp 5.5.0__py3-none-any.whl → 5.6.0rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "5.5.0"
32
+ __version__ = "5.6.0"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.11.0"
@@ -16,7 +16,7 @@
16
16
  # under the License.
17
17
  from __future__ import annotations
18
18
 
19
- from airflow.exceptions import AirflowException
19
+ from airflow.providers.common.compat.sdk import AirflowException
20
20
 
21
21
 
22
22
  class ConnectionNotOpenedException(AirflowException):
@@ -34,12 +34,10 @@ from typing import IO, TYPE_CHECKING, Any, cast
34
34
 
35
35
  import asyncssh
36
36
  from asgiref.sync import sync_to_async
37
+ from paramiko.config import SSH_PORT
37
38
 
38
- from airflow.exceptions import (
39
- AirflowException,
40
- AirflowProviderDeprecationWarning,
41
- )
42
- from airflow.providers.common.compat.sdk import BaseHook, Connection
39
+ from airflow.exceptions import AirflowProviderDeprecationWarning
40
+ from airflow.providers.common.compat.sdk import AirflowException, BaseHook, Connection
43
41
  from airflow.providers.sftp.exceptions import ConnectionNotOpenedException
44
42
  from airflow.providers.ssh.hooks.ssh import SSHHook
45
43
 
@@ -703,10 +701,10 @@ class SFTPHookAsync(BaseHook):
703
701
  def __init__( # nosec: B107
704
702
  self,
705
703
  sftp_conn_id: str = default_conn_name,
706
- host: str = "",
707
- port: int = 22,
708
- username: str = "",
709
- password: str = "",
704
+ host: str | None = None,
705
+ port: int | None = None,
706
+ username: str | None = None,
707
+ password: str | None = None,
710
708
  known_hosts: str = default_known_hosts,
711
709
  key_file: str = "",
712
710
  passphrase: str = "",
@@ -762,11 +760,19 @@ class SFTPHookAsync(BaseHook):
762
760
  if conn.extra is not None:
763
761
  self._parse_extras(conn) # type: ignore[arg-type]
764
762
 
765
- conn_config: dict[str, Any] = {
766
- "host": conn.host,
767
- "port": conn.port,
768
- "username": conn.login,
769
- "password": conn.password,
763
+ def _get_value(self_val, conn_val, default=None):
764
+ """Return the first non-None value among self, conn, default."""
765
+ if self_val is not None:
766
+ return self_val
767
+ if conn_val is not None:
768
+ return conn_val
769
+ return default
770
+
771
+ conn_config = {
772
+ "host": _get_value(self.host, conn.host),
773
+ "port": _get_value(self.port, conn.port, SSH_PORT),
774
+ "username": _get_value(self.username, conn.login),
775
+ "password": _get_value(self.password, conn.password),
770
776
  }
771
777
  if self.key_file:
772
778
  conn_config.update(client_keys=self.key_file)
@@ -27,8 +27,7 @@ from typing import Any
27
27
 
28
28
  import paramiko
29
29
 
30
- from airflow.exceptions import AirflowException
31
- from airflow.providers.common.compat.sdk import BaseOperator
30
+ from airflow.providers.common.compat.sdk import AirflowException, BaseOperator
32
31
  from airflow.providers.sftp.hooks.sftp import SFTPHook
33
32
 
34
33
 
@@ -26,9 +26,7 @@ from typing import TYPE_CHECKING, Any
26
26
 
27
27
  from paramiko.sftp import SFTP_NO_SUCH_FILE
28
28
 
29
- from airflow.configuration import conf
30
- from airflow.exceptions import AirflowException
31
- from airflow.providers.common.compat.sdk import BaseSensorOperator, PokeReturnValue
29
+ from airflow.providers.common.compat.sdk import AirflowException, BaseSensorOperator, PokeReturnValue, conf
32
30
  from airflow.providers.sftp.hooks.sftp import SFTPHook
33
31
  from airflow.providers.sftp.triggers.sftp import SFTPTrigger
34
32
  from airflow.utils.timezone import convert_to_utc, parse
@@ -45,6 +43,15 @@ class SFTPSensor(BaseSensorOperator):
45
43
  :param file_pattern: The pattern that will be used to match the file (fnmatch format)
46
44
  :param sftp_conn_id: The connection to run the sensor against
47
45
  :param newer_than: DateTime for which the file or file path should be newer than, comparison is inclusive
46
+ :param python_callable: Optional callable that will be called after files are found. The callable
47
+ will receive the found files list in ``op_kwargs['files_found']`` if ``op_kwargs`` is provided
48
+ and not empty. The return value of the callable will be stored in XCom along with the
49
+ files_found list.
50
+ :param op_args: A list of positional arguments that will get unpacked when calling your callable
51
+ (templated). Only used when ``python_callable`` is provided.
52
+ :param op_kwargs: A dictionary of keyword arguments that will get unpacked in your callable
53
+ (templated). If provided and not empty, the ``files_found`` list will be automatically added
54
+ to this dictionary. Only used when ``python_callable`` is provided.
48
55
  :param deferrable: If waiting for completion, whether to defer the task until done, default is ``False``.
49
56
  """
50
57
 
@@ -24,7 +24,7 @@ from typing import Any
24
24
 
25
25
  from dateutil.parser import parse as parse_date
26
26
 
27
- from airflow.exceptions import AirflowException
27
+ from airflow.providers.common.compat.sdk import AirflowException
28
28
  from airflow.providers.sftp.hooks.sftp import SFTPHookAsync
29
29
  from airflow.triggers.base import BaseTrigger, TriggerEvent
30
30
  from airflow.utils.timezone import convert_to_utc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-sftp
3
- Version: 5.5.0
3
+ Version: 5.6.0rc1
4
4
  Summary: Provider package apache-airflow-providers-sftp for Apache Airflow
5
5
  Keywords: airflow-provider,sftp,airflow,integration
6
6
  Author-email: Apache Software Foundation <dev@airflow.apache.org>
@@ -22,21 +22,19 @@ Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Topic :: System :: Monitoring
23
23
  License-File: LICENSE
24
24
  License-File: NOTICE
25
- Requires-Dist: apache-airflow>=2.11.0
26
- Requires-Dist: apache-airflow-providers-ssh>=4.0.0
27
- Requires-Dist: apache-airflow-providers-common-compat>=1.8.0
25
+ Requires-Dist: apache-airflow>=2.11.0rc1
26
+ Requires-Dist: apache-airflow-providers-ssh>=4.0.0rc1
27
+ Requires-Dist: apache-airflow-providers-common-compat>=1.12.0rc1
28
28
  Requires-Dist: paramiko>=2.9.0,<4.0.0
29
29
  Requires-Dist: asyncssh>=2.12.0
30
- Requires-Dist: apache-airflow-providers-common-compat ; extra == "common-compat"
31
30
  Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
32
31
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
33
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.5.0/changelog.html
34
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.5.0
32
+ Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-sftp/5.6.0/changelog.html
33
+ Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-sftp/5.6.0
35
34
  Project-URL: Mastodon, https://fosstodon.org/@airflow
36
35
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
37
36
  Project-URL: Source Code, https://github.com/apache/airflow
38
37
  Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
39
- Provides-Extra: common-compat
40
38
  Provides-Extra: openlineage
41
39
 
42
40
 
@@ -64,7 +62,7 @@ Provides-Extra: openlineage
64
62
 
65
63
  Package ``apache-airflow-providers-sftp``
66
64
 
67
- Release: ``5.5.0``
65
+ Release: ``5.6.0``
68
66
 
69
67
 
70
68
  `SSH File Transfer Protocol (SFTP) <https://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/>`__
@@ -77,7 +75,7 @@ This is a provider package for ``sftp`` provider. All classes for this provider
77
75
  are in ``airflow.providers.sftp`` python package.
78
76
 
79
77
  You can find package information and changelog for the provider
80
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.5.0/>`_.
78
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.6.0/>`_.
81
79
 
82
80
  Installation
83
81
  ------------
@@ -96,7 +94,7 @@ PIP package Version required
96
94
  ========================================== ==================
97
95
  ``apache-airflow`` ``>=2.11.0``
98
96
  ``apache-airflow-providers-ssh`` ``>=4.0.0``
99
- ``apache-airflow-providers-common-compat`` ``>=1.8.0``
97
+ ``apache-airflow-providers-common-compat`` ``>=1.10.1``
100
98
  ``paramiko`` ``>=2.9.0,<4.0.0``
101
99
  ``asyncssh`` ``>=2.12.0``
102
100
  ========================================== ==================
@@ -133,5 +131,5 @@ Extra Dependencies
133
131
  ================= ==========================================
134
132
 
135
133
  The changelog for the provider package can be found in the
136
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.5.0/changelog.html>`_.
134
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.6.0/changelog.html>`_.
137
135
 
@@ -0,0 +1,21 @@
1
+ airflow/providers/sftp/__init__.py,sha256=_mHn6lC6dVIJLo3grWbwFnruKtVAF0N2hyXODHFCfMo,1493
2
+ airflow/providers/sftp/exceptions.py,sha256=DYy0hHoCuM5YzY-6c1oNwxeIZYINwzF6bW2tuJmhOj8,1028
3
+ airflow/providers/sftp/get_provider_info.py,sha256=qjHxUHBGnbyHCwXgKYbTNGNvKtc7l213wrVy7yjHf_c,3002
4
+ airflow/providers/sftp/version_compat.py,sha256=2mExLgLL122lERfq14OjfiylWzp1FJVdoTwov_DdyJA,1666
5
+ airflow/providers/sftp/decorators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
6
+ airflow/providers/sftp/decorators/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
7
+ airflow/providers/sftp/decorators/sensors/sftp.py,sha256=3Zy1TUqoUuw0I3c8fQXH2DrQR5p4rk4X1GG17afE_lE,2882
8
+ airflow/providers/sftp/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
9
+ airflow/providers/sftp/hooks/sftp.py,sha256=m1ZG50G-W8kkxwpTc_JVdXntajK_AMBZOhS3ZqmEDiA,34654
10
+ airflow/providers/sftp/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
11
+ airflow/providers/sftp/operators/sftp.py,sha256=vsfdKjaFAuE1AGA5tiHfG6ISfaVF8mpTt4XaPxTrZtc,13151
12
+ airflow/providers/sftp/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
13
+ airflow/providers/sftp/sensors/sftp.py,sha256=jBL3YaCR70GoXzaToA8o-EAji0S12P5PcOLzjW0iNls,9595
14
+ airflow/providers/sftp/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
15
+ airflow/providers/sftp/triggers/sftp.py,sha256=-FHAwWfuHHIhuB9M6q7ZqqIEOyoTodSU1dnpD5gchfg,6181
16
+ apache_airflow_providers_sftp-5.6.0rc1.dist-info/entry_points.txt,sha256=Fa1IkUHV6qnIuwLd0U7tKoklbLXXVrbB2hhG6N7Q-zo,100
17
+ apache_airflow_providers_sftp-5.6.0rc1.dist-info/licenses/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
18
+ apache_airflow_providers_sftp-5.6.0rc1.dist-info/licenses/NOTICE,sha256=_cWHznIoUSbLCY_KfmKqetlKlsoH0c2VBjmZjElAzuc,168
19
+ apache_airflow_providers_sftp-5.6.0rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
20
+ apache_airflow_providers_sftp-5.6.0rc1.dist-info/METADATA,sha256=Kq765AIvqp44WLXrDLxcpyJ7Jv6raObRTrNwtw83cSA,6206
21
+ apache_airflow_providers_sftp-5.6.0rc1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Apache Airflow
2
- Copyright 2016-2025 The Apache Software Foundation
2
+ Copyright 2016-2026 The Apache Software Foundation
3
3
 
4
4
  This product includes software developed at
5
5
  The Apache Software Foundation (http://www.apache.org/).
@@ -1,21 +0,0 @@
1
- airflow/providers/sftp/__init__.py,sha256=0lEZa-04EGS9xzkrUgUrF_UrIfI7xniRpBmrcBzUVMw,1493
2
- airflow/providers/sftp/exceptions.py,sha256=Gz4mk1YkBUFE1ridk-C7dcu9Y3JPdkp5MUyQOwWOWyY,1011
3
- airflow/providers/sftp/get_provider_info.py,sha256=qjHxUHBGnbyHCwXgKYbTNGNvKtc7l213wrVy7yjHf_c,3002
4
- airflow/providers/sftp/version_compat.py,sha256=2mExLgLL122lERfq14OjfiylWzp1FJVdoTwov_DdyJA,1666
5
- airflow/providers/sftp/decorators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
6
- airflow/providers/sftp/decorators/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
7
- airflow/providers/sftp/decorators/sensors/sftp.py,sha256=3Zy1TUqoUuw0I3c8fQXH2DrQR5p4rk4X1GG17afE_lE,2882
8
- airflow/providers/sftp/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
9
- airflow/providers/sftp/hooks/sftp.py,sha256=_aF4J8Daw-fvXeFijGFFmNMzecgEHQwrX_zw0vswFns,34199
10
- airflow/providers/sftp/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
11
- airflow/providers/sftp/operators/sftp.py,sha256=i3DsNYdZjv7E03chU58VKfkm2PxJqmU5WHWvRhBxCpA,13181
12
- airflow/providers/sftp/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
13
- airflow/providers/sftp/sensors/sftp.py,sha256=fRxp3Ap--sjjUbfnRrsXWPzDt1xCKu49ZClzSi9cvDw,8890
14
- airflow/providers/sftp/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
15
- airflow/providers/sftp/triggers/sftp.py,sha256=e_zdgyg2Y9T2bvCP57a2GZN0rBLW_R_t0V6kquvV2GY,6164
16
- apache_airflow_providers_sftp-5.5.0.dist-info/entry_points.txt,sha256=Fa1IkUHV6qnIuwLd0U7tKoklbLXXVrbB2hhG6N7Q-zo,100
17
- apache_airflow_providers_sftp-5.5.0.dist-info/licenses/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
18
- apache_airflow_providers_sftp-5.5.0.dist-info/licenses/NOTICE,sha256=E3-_E02gwwSEFzeeWPKmnIjOoos3hW28CLISV6sYrbQ,168
19
- apache_airflow_providers_sftp-5.5.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
20
- apache_airflow_providers_sftp-5.5.0.dist-info/METADATA,sha256=Ocl4UEMGMZsw2t2OJej_XL2rUUrZTq5ucqEy0gis7K4,6289
21
- apache_airflow_providers_sftp-5.5.0.dist-info/RECORD,,