apache-airflow-providers-sftp 5.4.0rc1__py3-none-any.whl → 5.4.2rc1__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.4.0"
32
+ __version__ = "5.4.2"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.10.0"
@@ -19,16 +19,7 @@ from __future__ import annotations
19
19
 
20
20
  from collections.abc import Callable, Sequence
21
21
 
22
- from airflow.providers.sftp.version_compat import AIRFLOW_V_3_0_PLUS
23
-
24
- if AIRFLOW_V_3_0_PLUS:
25
- from airflow.sdk.bases.decorator import TaskDecorator, get_unique_task_id, task_decorator_factory
26
- else:
27
- from airflow.decorators.base import ( # type: ignore[no-redef]
28
- TaskDecorator,
29
- get_unique_task_id,
30
- task_decorator_factory,
31
- )
22
+ from airflow.providers.common.compat.sdk import TaskDecorator, get_unique_task_id, task_decorator_factory
32
23
  from airflow.providers.sftp.sensors.sftp import SFTPSensor
33
24
 
34
25
 
@@ -30,6 +30,7 @@ def get_provider_info():
30
30
  {
31
31
  "integration-name": "SSH File Transfer Protocol (SFTP)",
32
32
  "external-doc-url": "https://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/",
33
+ "how-to-guide": ["/docs/apache-airflow-providers-sftp/sensors/sftp_sensor.rst"],
33
34
  "logo": "/docs/integration-logos/SFTP.png",
34
35
  "tags": ["protocol"],
35
36
  }
@@ -39,8 +39,8 @@ from airflow.exceptions import (
39
39
  AirflowException,
40
40
  AirflowProviderDeprecationWarning,
41
41
  )
42
+ from airflow.providers.common.compat.sdk import BaseHook, Connection
42
43
  from airflow.providers.sftp.exceptions import ConnectionNotOpenedException
43
- from airflow.providers.sftp.version_compat import BaseHook
44
44
  from airflow.providers.ssh.hooks.ssh import SSHHook
45
45
 
46
46
  if TYPE_CHECKING:
@@ -48,8 +48,6 @@ if TYPE_CHECKING:
48
48
  from paramiko.sftp_attr import SFTPAttributes
49
49
  from paramiko.sftp_client import SFTPClient
50
50
 
51
- from airflow.models.connection import Connection
52
-
53
51
 
54
52
  def handle_connection_management(func: Callable) -> Callable:
55
53
  @functools.wraps(func)
@@ -28,8 +28,8 @@ from typing import Any
28
28
  import paramiko
29
29
 
30
30
  from airflow.exceptions import AirflowException
31
+ from airflow.providers.common.compat.sdk import BaseOperator
31
32
  from airflow.providers.sftp.hooks.sftp import SFTPHook
32
- from airflow.providers.sftp.version_compat import BaseOperator
33
33
 
34
34
 
35
35
  class SFTPOperation:
@@ -144,24 +144,25 @@ class SFTPOperator(BaseOperator):
144
144
 
145
145
  file_msg = None
146
146
  try:
147
+ if self.remote_host is not None:
148
+ self.log.info(
149
+ "remote_host is provided explicitly. "
150
+ "It will replace the remote_host which was defined "
151
+ "in sftp_hook or predefined in connection of ssh_conn_id."
152
+ )
153
+
147
154
  if self.ssh_conn_id:
148
155
  if self.sftp_hook and isinstance(self.sftp_hook, SFTPHook):
149
156
  self.log.info("ssh_conn_id is ignored when sftp_hook is provided.")
150
157
  else:
151
158
  self.log.info("sftp_hook not provided or invalid. Trying ssh_conn_id to create SFTPHook.")
152
- self.sftp_hook = SFTPHook(ssh_conn_id=self.ssh_conn_id)
159
+ self.sftp_hook = SFTPHook(
160
+ ssh_conn_id=self.ssh_conn_id, remote_host=self.remote_host or ""
161
+ )
153
162
 
154
163
  if not self.sftp_hook:
155
164
  raise AirflowException("Cannot operate without sftp_hook or ssh_conn_id.")
156
165
 
157
- if self.remote_host is not None:
158
- self.log.info(
159
- "remote_host is provided explicitly. "
160
- "It will replace the remote_host which was defined "
161
- "in sftp_hook or predefined in connection of ssh_conn_id."
162
- )
163
- self.sftp_hook.remote_host = self.remote_host
164
-
165
166
  if self.operation.lower() in (SFTPOperation.GET, SFTPOperation.PUT):
166
167
  for _local_filepath, _remote_filepath in zip(local_filepath_array, remote_filepath_array):
167
168
  if self.operation.lower() == SFTPOperation.GET:
@@ -28,17 +28,13 @@ from paramiko.sftp import SFTP_NO_SUCH_FILE
28
28
 
29
29
  from airflow.configuration import conf
30
30
  from airflow.exceptions import AirflowException
31
+ from airflow.providers.common.compat.sdk import BaseSensorOperator, PokeReturnValue
31
32
  from airflow.providers.sftp.hooks.sftp import SFTPHook
32
33
  from airflow.providers.sftp.triggers.sftp import SFTPTrigger
33
- from airflow.providers.sftp.version_compat import BaseSensorOperator, PokeReturnValue
34
34
  from airflow.utils.timezone import convert_to_utc, parse
35
35
 
36
36
  if TYPE_CHECKING:
37
- try:
38
- from airflow.sdk.definitions.context import Context
39
- except ImportError:
40
- # TODO: Remove once provider drops support for Airflow 2
41
- from airflow.utils.context import Context
37
+ from airflow.providers.common.compat.sdk import Context
42
38
 
43
39
 
44
40
  class SFTPSensor(BaseSensorOperator):
@@ -35,15 +35,5 @@ def get_base_airflow_version_tuple() -> tuple[int, int, int]:
35
35
  AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
36
36
  AIRFLOW_V_3_1_PLUS: bool = get_base_airflow_version_tuple() >= (3, 1, 0)
37
37
 
38
- if AIRFLOW_V_3_1_PLUS:
39
- from airflow.sdk import BaseHook
40
- else:
41
- from airflow.hooks.base import BaseHook # type: ignore[attr-defined,no-redef]
42
-
43
- if AIRFLOW_V_3_0_PLUS:
44
- from airflow.sdk import BaseOperator, BaseSensorOperator, PokeReturnValue
45
- else:
46
- from airflow.models import BaseOperator
47
- from airflow.sensors.base import BaseSensorOperator, PokeReturnValue # type: ignore[no-redef]
48
-
49
- __all__ = ["AIRFLOW_V_3_0_PLUS", "BaseHook", "BaseOperator", "BaseSensorOperator", "PokeReturnValue"]
38
+
39
+ __all__ = ["AIRFLOW_V_3_0_PLUS", "AIRFLOW_V_3_1_PLUS"]
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-sftp
3
- Version: 5.4.0rc1
3
+ Version: 5.4.2rc1
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>
7
7
  Maintainer-email: Apache Software Foundation <dev@airflow.apache.org>
8
8
  Requires-Python: >=3.10
9
9
  Description-Content-Type: text/x-rst
10
+ License-Expression: Apache-2.0
10
11
  Classifier: Development Status :: 5 - Production/Stable
11
12
  Classifier: Environment :: Console
12
13
  Classifier: Environment :: Web Environment
@@ -14,21 +15,23 @@ Classifier: Intended Audience :: Developers
14
15
  Classifier: Intended Audience :: System Administrators
15
16
  Classifier: Framework :: Apache Airflow
16
17
  Classifier: Framework :: Apache Airflow :: Provider
17
- Classifier: License :: OSI Approved :: Apache Software License
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
21
  Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Topic :: System :: Monitoring
23
+ License-File: LICENSE
24
+ License-File: NOTICE
23
25
  Requires-Dist: apache-airflow>=2.10.0rc1
24
26
  Requires-Dist: apache-airflow-providers-ssh>=4.0.0rc1
27
+ Requires-Dist: apache-airflow-providers-common-compat>=1.8.0rc1
25
28
  Requires-Dist: paramiko>=2.9.0,<4.0.0
26
29
  Requires-Dist: asyncssh>=2.12.0
27
30
  Requires-Dist: apache-airflow-providers-common-compat ; extra == "common-compat"
28
31
  Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
29
32
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
30
- Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-sftp/5.4.0/changelog.html
31
- Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-sftp/5.4.0
33
+ Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-sftp/5.4.2/changelog.html
34
+ Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-sftp/5.4.2
32
35
  Project-URL: Mastodon, https://fosstodon.org/@airflow
33
36
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
34
37
  Project-URL: Source Code, https://github.com/apache/airflow
@@ -61,7 +64,7 @@ Provides-Extra: openlineage
61
64
 
62
65
  Package ``apache-airflow-providers-sftp``
63
66
 
64
- Release: ``5.4.0``
67
+ Release: ``5.4.2``
65
68
 
66
69
 
67
70
  `SSH File Transfer Protocol (SFTP) <https://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/>`__
@@ -74,7 +77,7 @@ This is a provider package for ``sftp`` provider. All classes for this provider
74
77
  are in ``airflow.providers.sftp`` python package.
75
78
 
76
79
  You can find package information and changelog for the provider
77
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.4.0/>`_.
80
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.4.2/>`_.
78
81
 
79
82
  Installation
80
83
  ------------
@@ -88,14 +91,15 @@ The package supports the following python versions: 3.10,3.11,3.12,3.13
88
91
  Requirements
89
92
  ------------
90
93
 
91
- ================================ ==================
92
- PIP package Version required
93
- ================================ ==================
94
- ``apache-airflow`` ``>=2.10.0``
95
- ``apache-airflow-providers-ssh`` ``>=4.0.0``
96
- ``paramiko`` ``>=2.9.0,<4.0.0``
97
- ``asyncssh`` ``>=2.12.0``
98
- ================================ ==================
94
+ ========================================== ==================
95
+ PIP package Version required
96
+ ========================================== ==================
97
+ ``apache-airflow`` ``>=2.10.0``
98
+ ``apache-airflow-providers-ssh`` ``>=4.0.0``
99
+ ``apache-airflow-providers-common-compat`` ``>=1.8.0``
100
+ ``paramiko`` ``>=2.9.0,<4.0.0``
101
+ ``asyncssh`` ``>=2.12.0``
102
+ ========================================== ==================
99
103
 
100
104
  Cross provider package dependencies
101
105
  -----------------------------------
@@ -118,6 +122,16 @@ Dependent package
118
122
  `apache-airflow-providers-ssh <https://airflow.apache.org/docs/apache-airflow-providers-ssh>`_ ``ssh``
119
123
  ================================================================================================================== =================
120
124
 
125
+ Optional dependencies
126
+ ----------------------
127
+
128
+ ================= ==========================================
129
+ Extra Dependencies
130
+ ================= ==========================================
131
+ ``common.compat`` ``apache-airflow-providers-common-compat``
132
+ ``openlineage`` ``apache-airflow-providers-openlineage``
133
+ ================= ==========================================
134
+
121
135
  The changelog for the provider package can be found in the
122
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.4.0/changelog.html>`_.
136
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.4.2/changelog.html>`_.
123
137
 
@@ -0,0 +1,21 @@
1
+ airflow/providers/sftp/__init__.py,sha256=nz8UVgDO9f9wc1gCKEhfMnJJm6eXT5SYV3S9i8fc8XA,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.4.2rc1.dist-info/entry_points.txt,sha256=Fa1IkUHV6qnIuwLd0U7tKoklbLXXVrbB2hhG6N7Q-zo,100
17
+ apache_airflow_providers_sftp-5.4.2rc1.dist-info/licenses/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
18
+ apache_airflow_providers_sftp-5.4.2rc1.dist-info/licenses/NOTICE,sha256=E3-_E02gwwSEFzeeWPKmnIjOoos3hW28CLISV6sYrbQ,168
19
+ apache_airflow_providers_sftp-5.4.2rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
20
+ apache_airflow_providers_sftp-5.4.2rc1.dist-info/METADATA,sha256=ORN4p9Rumoh--MFN4EHXp_x37U7lhf5znluCTgkr4J4,6315
21
+ apache_airflow_providers_sftp-5.4.2rc1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Apache Airflow
2
+ Copyright 2016-2025 The Apache Software Foundation
3
+
4
+ This product includes software developed at
5
+ The Apache Software Foundation (http://www.apache.org/).
@@ -1,20 +0,0 @@
1
- airflow/providers/sftp/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
2
- airflow/providers/sftp/__init__.py,sha256=2_2-3dIZSX-De7bo1jjbJcecfQsOTgJNV-ZuACXOllU,1493
3
- airflow/providers/sftp/exceptions.py,sha256=Gz4mk1YkBUFE1ridk-C7dcu9Y3JPdkp5MUyQOwWOWyY,1011
4
- airflow/providers/sftp/get_provider_info.py,sha256=_IqUGQ-rKpZsSAsXdTsGYzfzJ3X57duhn-2b0-rFOz0,2905
5
- airflow/providers/sftp/version_compat.py,sha256=zRB-sKs65ic8Gl2QARSOaJ8ScjIRw58pt0kR6nOQPPY,2113
6
- airflow/providers/sftp/decorators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
7
- airflow/providers/sftp/decorators/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
8
- airflow/providers/sftp/decorators/sensors/sftp.py,sha256=O-rkLJ_-B49aRZ5W9vpHcCeMo5bA1DOm_iVdKp8lwLE,3134
9
- airflow/providers/sftp/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
10
- airflow/providers/sftp/hooks/sftp.py,sha256=5qpttnQVZ2_2ZsS_u72-ugy66GOC97CzcSSzyiMj7c8,34243
11
- airflow/providers/sftp/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
12
- airflow/providers/sftp/operators/sftp.py,sha256=exoHmvnsjvefFJF4OatWBexdBm30khjwRvLvhS6Yv08,13163
13
- airflow/providers/sftp/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
14
- airflow/providers/sftp/sensors/sftp.py,sha256=XXtwu3PzzYNcNlI-xhHhTT2SmIlIrA3r4NkDbYpW3Z0,9040
15
- airflow/providers/sftp/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
16
- airflow/providers/sftp/triggers/sftp.py,sha256=e_zdgyg2Y9T2bvCP57a2GZN0rBLW_R_t0V6kquvV2GY,6164
17
- apache_airflow_providers_sftp-5.4.0rc1.dist-info/entry_points.txt,sha256=Fa1IkUHV6qnIuwLd0U7tKoklbLXXVrbB2hhG6N7Q-zo,100
18
- apache_airflow_providers_sftp-5.4.0rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
19
- apache_airflow_providers_sftp-5.4.0rc1.dist-info/METADATA,sha256=UaAI7fnaYMpoPqDwdJhK8HPOpSD8DJvp2mJ_EaqmMF4,5717
20
- apache_airflow_providers_sftp-5.4.0rc1.dist-info/RECORD,,