apache-airflow-providers-sftp 5.3.1__py3-none-any.whl → 5.3.2__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.3.1"
32
+ __version__ = "5.3.2"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.10.0"
@@ -17,8 +17,7 @@
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
- from collections.abc import Sequence
21
- from typing import Callable
20
+ from collections.abc import Callable, Sequence
22
21
 
23
22
  from airflow.providers.sftp.version_compat import AIRFLOW_V_3_0_PLUS
24
23
 
@@ -24,20 +24,24 @@ import datetime
24
24
  import os
25
25
  import stat
26
26
  import warnings
27
- from collections.abc import Generator, Sequence
27
+ from collections.abc import Callable, Generator, Sequence
28
28
  from contextlib import contextmanager
29
29
  from fnmatch import fnmatch
30
30
  from io import BytesIO
31
31
  from pathlib import Path
32
- from typing import TYPE_CHECKING, Any, Callable
32
+ from typing import TYPE_CHECKING, Any
33
33
 
34
34
  import asyncssh
35
35
  from asgiref.sync import sync_to_async
36
36
 
37
37
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
38
- from airflow.hooks.base import BaseHook
39
38
  from airflow.providers.ssh.hooks.ssh import SSHHook
40
39
 
40
+ try:
41
+ from airflow.sdk import BaseHook
42
+ except ImportError:
43
+ from airflow.hooks.base import BaseHook # type: ignore[attr-defined,no-redef]
44
+
41
45
  if TYPE_CHECKING:
42
46
  from paramiko import SSHClient
43
47
  from paramiko.sftp_attr import SFTPAttributes
@@ -148,6 +152,8 @@ class SFTPHook(SSHHook):
148
152
  self._sftp_conn = None
149
153
  self._ssh_conn.close()
150
154
  self._ssh_conn = None
155
+ if hasattr(self, "host_proxy"):
156
+ del self.host_proxy
151
157
 
152
158
  def get_conn_count(self) -> int:
153
159
  """Get the number of open connections."""
@@ -723,9 +729,9 @@ class SFTPHookAsync(BaseHook):
723
729
  """
724
730
  conn = await sync_to_async(self.get_connection)(self.sftp_conn_id)
725
731
  if conn.extra is not None:
726
- self._parse_extras(conn)
732
+ self._parse_extras(conn) # type: ignore[arg-type]
727
733
 
728
- conn_config = {
734
+ conn_config: dict[str, Any] = {
729
735
  "host": conn.host,
730
736
  "port": conn.port,
731
737
  "username": conn.login,
@@ -737,10 +743,10 @@ class SFTPHookAsync(BaseHook):
737
743
  if self.known_hosts.lower() == "none":
738
744
  conn_config.update(known_hosts=None)
739
745
  else:
740
- conn_config.update(known_hosts=self.known_hosts)
746
+ conn_config.update(known_hosts=self.known_hosts) # type: ignore
741
747
  if self.private_key:
742
748
  _private_key = asyncssh.import_private_key(self.private_key, self.passphrase)
743
- conn_config.update(client_keys=[_private_key])
749
+ conn_config["client_keys"] = [_private_key]
744
750
  if self.passphrase:
745
751
  conn_config.update(passphrase=self.passphrase)
746
752
  ssh_client_conn = await asyncssh.connect(**conn_config)
@@ -28,8 +28,8 @@ from typing import Any
28
28
  import paramiko
29
29
 
30
30
  from airflow.exceptions import AirflowException
31
- from airflow.models import BaseOperator
32
31
  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:
@@ -20,9 +20,9 @@
20
20
  from __future__ import annotations
21
21
 
22
22
  import os
23
- from collections.abc import Sequence
23
+ from collections.abc import Callable, Sequence
24
24
  from datetime import datetime, timedelta
25
- from typing import TYPE_CHECKING, Any, Callable
25
+ from typing import TYPE_CHECKING, Any
26
26
 
27
27
  from paramiko.sftp import SFTP_NO_SUCH_FILE
28
28
 
@@ -30,7 +30,7 @@ from airflow.configuration import conf
30
30
  from airflow.exceptions import AirflowException
31
31
  from airflow.providers.sftp.hooks.sftp import SFTPHook
32
32
  from airflow.providers.sftp.triggers.sftp import SFTPTrigger
33
- from airflow.sensors.base import BaseSensorOperator, PokeReturnValue
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:
@@ -33,3 +33,11 @@ def get_base_airflow_version_tuple() -> tuple[int, int, int]:
33
33
 
34
34
 
35
35
  AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
36
+
37
+ if AIRFLOW_V_3_0_PLUS:
38
+ from airflow.sdk import BaseOperator, BaseSensorOperator, PokeReturnValue
39
+ else:
40
+ from airflow.models import BaseOperator
41
+ from airflow.sensors.base import BaseSensorOperator, PokeReturnValue # type: ignore[no-redef]
42
+
43
+ __all__ = ["AIRFLOW_V_3_0_PLUS", "BaseOperator", "BaseSensorOperator", "PokeReturnValue"]
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-sftp
3
- Version: 5.3.1
3
+ Version: 5.3.2
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
- Requires-Python: ~=3.9
8
+ Requires-Python: ~=3.10
9
9
  Description-Content-Type: text/x-rst
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Environment :: Console
@@ -15,7 +15,6 @@ Classifier: Intended Audience :: System Administrators
15
15
  Classifier: Framework :: Apache Airflow
16
16
  Classifier: Framework :: Apache Airflow :: Provider
17
17
  Classifier: License :: OSI Approved :: Apache Software License
18
- Classifier: Programming Language :: Python :: 3.9
19
18
  Classifier: Programming Language :: Python :: 3.10
20
19
  Classifier: Programming Language :: Python :: 3.11
21
20
  Classifier: Programming Language :: Python :: 3.12
@@ -27,8 +26,8 @@ Requires-Dist: asyncssh>=2.12.0
27
26
  Requires-Dist: apache-airflow-providers-common-compat ; extra == "common-compat"
28
27
  Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
29
28
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
30
- Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.1/changelog.html
31
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.1
29
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.2/changelog.html
30
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.2
32
31
  Project-URL: Mastodon, https://fosstodon.org/@airflow
33
32
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
34
33
  Project-URL: Source Code, https://github.com/apache/airflow
@@ -61,7 +60,7 @@ Provides-Extra: openlineage
61
60
 
62
61
  Package ``apache-airflow-providers-sftp``
63
62
 
64
- Release: ``5.3.1``
63
+ Release: ``5.3.2``
65
64
 
66
65
 
67
66
  `SSH File Transfer Protocol (SFTP) <https://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/>`__
@@ -74,7 +73,7 @@ This is a provider package for ``sftp`` provider. All classes for this provider
74
73
  are in ``airflow.providers.sftp`` python package.
75
74
 
76
75
  You can find package information and changelog for the provider
77
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.1/>`_.
76
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.2/>`_.
78
77
 
79
78
  Installation
80
79
  ------------
@@ -83,7 +82,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
83
82
  for the minimum Airflow version supported) via
84
83
  ``pip install apache-airflow-providers-sftp``
85
84
 
86
- The package supports the following python versions: 3.9,3.10,3.11,3.12
85
+ The package supports the following python versions: 3.10,3.11,3.12
87
86
 
88
87
  Requirements
89
88
  ------------
@@ -119,5 +118,5 @@ Dependent package
119
118
  ================================================================================================================== =================
120
119
 
121
120
  The changelog for the provider package can be found in the
122
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.1/changelog.html>`_.
121
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.2/changelog.html>`_.
123
122
 
@@ -1,19 +1,19 @@
1
1
  airflow/providers/sftp/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
2
- airflow/providers/sftp/__init__.py,sha256=Xjl4kCKRbGICEs9flkeiTlIpHIGlgWUW_bfu78Dhprs,1493
2
+ airflow/providers/sftp/__init__.py,sha256=lYds5hVWJaOJ-sr51-Qfkf9774cZ2GXP9aJGOj5sogM,1493
3
3
  airflow/providers/sftp/get_provider_info.py,sha256=_IqUGQ-rKpZsSAsXdTsGYzfzJ3X57duhn-2b0-rFOz0,2905
4
- airflow/providers/sftp/version_compat.py,sha256=j5PCtXvZ71aBjixu-EFTNtVDPsngzzs7os0ZQDgFVDk,1536
4
+ airflow/providers/sftp/version_compat.py,sha256=No2jWhkrX-sJqYuntfvfkrnyt6hRu4Gqg4YnUMePLHE,1878
5
5
  airflow/providers/sftp/decorators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
6
6
  airflow/providers/sftp/decorators/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
7
- airflow/providers/sftp/decorators/sensors/sftp.py,sha256=htmylsF0h93Loova_rq7_ebJQAjBgJlbHgC9rSVpwww,3152
7
+ airflow/providers/sftp/decorators/sensors/sftp.py,sha256=O-rkLJ_-B49aRZ5W9vpHcCeMo5bA1DOm_iVdKp8lwLE,3134
8
8
  airflow/providers/sftp/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
9
- airflow/providers/sftp/hooks/sftp.py,sha256=r80l3jTYVzvXZF2hVpHWQ1aeY_Uy127EEVqGHxUXCsA,32271
9
+ airflow/providers/sftp/hooks/sftp.py,sha256=SzyF8JZwmn09qIkBf9zEqE6C-xkxhUByjrCbRrbXcUQ,32520
10
10
  airflow/providers/sftp/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
11
- airflow/providers/sftp/operators/sftp.py,sha256=WSHPIGLUZD62knz_uBweVfMIi4tqMCDmUHBl9umKrbY,12940
11
+ airflow/providers/sftp/operators/sftp.py,sha256=O7vpg6GrBKjSjvrTHat7JVlKIgKaJOSf4awFkY9h5Wo,12963
12
12
  airflow/providers/sftp/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
13
- airflow/providers/sftp/sensors/sftp.py,sha256=1xku3zJmBQ1aeh2pTb4U_A7OXSCEQ_A_aiNBb2F1cr8,8470
13
+ airflow/providers/sftp/sensors/sftp.py,sha256=NlluZ-UHwL8gzWMOa-QWkJ-ETI3G9w9PMfqxsfBywJA,8487
14
14
  airflow/providers/sftp/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
15
15
  airflow/providers/sftp/triggers/sftp.py,sha256=fSi-I5FocNQblHt4GYfGispFgOOl8XQ9Vk9ZFLcv_Sw,6182
16
- apache_airflow_providers_sftp-5.3.1.dist-info/entry_points.txt,sha256=Fa1IkUHV6qnIuwLd0U7tKoklbLXXVrbB2hhG6N7Q-zo,100
17
- apache_airflow_providers_sftp-5.3.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
18
- apache_airflow_providers_sftp-5.3.1.dist-info/METADATA,sha256=sGN0wQm5G2Y8RcprXon9xeTUSl2XnUSzDZ_XQcREju8,5679
19
- apache_airflow_providers_sftp-5.3.1.dist-info/RECORD,,
16
+ apache_airflow_providers_sftp-5.3.2.dist-info/entry_points.txt,sha256=Fa1IkUHV6qnIuwLd0U7tKoklbLXXVrbB2hhG6N7Q-zo,100
17
+ apache_airflow_providers_sftp-5.3.2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
18
+ apache_airflow_providers_sftp-5.3.2.dist-info/METADATA,sha256=2Zo0quTNsC9hbgLA6lKXP2bArx4G08cl1Z2Y_0_9Js4,5626
19
+ apache_airflow_providers_sftp-5.3.2.dist-info/RECORD,,