apache-airflow-providers-sftp 4.10.2__py3-none-any.whl → 4.10.3__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.
- airflow/providers/sftp/__init__.py +1 -1
- airflow/providers/sftp/get_provider_info.py +2 -1
- airflow/providers/sftp/hooks/sftp.py +36 -18
- airflow/providers/sftp/operators/sftp.py +1 -2
- {apache_airflow_providers_sftp-4.10.2.dist-info → apache_airflow_providers_sftp-4.10.3.dist-info}/METADATA +16 -13
- {apache_airflow_providers_sftp-4.10.2.dist-info → apache_airflow_providers_sftp-4.10.3.dist-info}/RECORD +8 -8
- {apache_airflow_providers_sftp-4.10.2.dist-info → apache_airflow_providers_sftp-4.10.3.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_sftp-4.10.2.dist-info → apache_airflow_providers_sftp-4.10.3.dist-info}/entry_points.txt +0 -0
@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
|
|
29
29
|
|
30
30
|
__all__ = ["__version__"]
|
31
31
|
|
32
|
-
__version__ = "4.10.
|
32
|
+
__version__ = "4.10.3"
|
33
33
|
|
34
34
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
35
35
|
"2.7.0"
|
@@ -28,8 +28,9 @@ def get_provider_info():
|
|
28
28
|
"name": "SFTP",
|
29
29
|
"description": "`SSH File Transfer Protocol (SFTP) <https://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/>`__\n",
|
30
30
|
"state": "ready",
|
31
|
-
"source-date-epoch":
|
31
|
+
"source-date-epoch": 1722664831,
|
32
32
|
"versions": [
|
33
|
+
"4.10.3",
|
33
34
|
"4.10.2",
|
34
35
|
"4.10.1",
|
35
36
|
"4.10.0",
|
@@ -40,7 +40,8 @@ if TYPE_CHECKING:
|
|
40
40
|
|
41
41
|
|
42
42
|
class SFTPHook(SSHHook):
|
43
|
-
"""
|
43
|
+
"""
|
44
|
+
Interact with SFTP.
|
44
45
|
|
45
46
|
This hook inherits the SSH hook. Please refer to SSH hook for the input
|
46
47
|
arguments.
|
@@ -134,7 +135,8 @@ class SFTPHook(SSHHook):
|
|
134
135
|
self.conn = None
|
135
136
|
|
136
137
|
def describe_directory(self, path: str) -> dict[str, dict[str, str | int | None]]:
|
137
|
-
"""
|
138
|
+
"""
|
139
|
+
Get file information in a directory on the remote system.
|
138
140
|
|
139
141
|
The return format is ``{filename: {attributes}}``. The remote system
|
140
142
|
support the MLSD command.
|
@@ -154,7 +156,8 @@ class SFTPHook(SSHHook):
|
|
154
156
|
return files
|
155
157
|
|
156
158
|
def list_directory(self, path: str) -> list[str]:
|
157
|
-
"""
|
159
|
+
"""
|
160
|
+
List files in a directory on the remote system.
|
158
161
|
|
159
162
|
:param path: full path to the remote directory to list
|
160
163
|
"""
|
@@ -163,7 +166,8 @@ class SFTPHook(SSHHook):
|
|
163
166
|
return files
|
164
167
|
|
165
168
|
def mkdir(self, path: str, mode: int = 0o777) -> None:
|
166
|
-
"""
|
169
|
+
"""
|
170
|
+
Create a directory on the remote system.
|
167
171
|
|
168
172
|
The default mode is ``0o777``, but on some systems, the current umask
|
169
173
|
value may be first masked out.
|
@@ -175,7 +179,8 @@ class SFTPHook(SSHHook):
|
|
175
179
|
conn.mkdir(path, mode=mode)
|
176
180
|
|
177
181
|
def isdir(self, path: str) -> bool:
|
178
|
-
"""
|
182
|
+
"""
|
183
|
+
Check if the path provided is a directory.
|
179
184
|
|
180
185
|
:param path: full path to the remote directory to check
|
181
186
|
"""
|
@@ -187,7 +192,8 @@ class SFTPHook(SSHHook):
|
|
187
192
|
return result
|
188
193
|
|
189
194
|
def isfile(self, path: str) -> bool:
|
190
|
-
"""
|
195
|
+
"""
|
196
|
+
Check if the path provided is a file.
|
191
197
|
|
192
198
|
:param path: full path to the remote file to check
|
193
199
|
"""
|
@@ -199,7 +205,8 @@ class SFTPHook(SSHHook):
|
|
199
205
|
return result
|
200
206
|
|
201
207
|
def create_directory(self, path: str, mode: int = 0o777) -> None:
|
202
|
-
"""
|
208
|
+
"""
|
209
|
+
Create a directory on the remote system.
|
203
210
|
|
204
211
|
The default mode is ``0o777``, but on some systems, the current umask
|
205
212
|
value may be first masked out. Different from :func:`.mkdir`, this
|
@@ -224,7 +231,8 @@ class SFTPHook(SSHHook):
|
|
224
231
|
conn.mkdir(path, mode=mode)
|
225
232
|
|
226
233
|
def delete_directory(self, path: str) -> None:
|
227
|
-
"""
|
234
|
+
"""
|
235
|
+
Delete a directory on the remote system.
|
228
236
|
|
229
237
|
:param path: full path to the remote directory to delete
|
230
238
|
"""
|
@@ -232,7 +240,8 @@ class SFTPHook(SSHHook):
|
|
232
240
|
conn.rmdir(path)
|
233
241
|
|
234
242
|
def retrieve_file(self, remote_full_path: str, local_full_path: str, prefetch: bool = True) -> None:
|
235
|
-
"""
|
243
|
+
"""
|
244
|
+
Transfer the remote file to a local location.
|
236
245
|
|
237
246
|
If local_full_path is a string path, the file will be put
|
238
247
|
at that location.
|
@@ -245,7 +254,8 @@ class SFTPHook(SSHHook):
|
|
245
254
|
conn.get(remote_full_path, local_full_path, prefetch=prefetch)
|
246
255
|
|
247
256
|
def store_file(self, remote_full_path: str, local_full_path: str, confirm: bool = True) -> None:
|
248
|
-
"""
|
257
|
+
"""
|
258
|
+
Transfer a local file to the remote location.
|
249
259
|
|
250
260
|
If local_full_path_or_buffer is a string path, the file will be read
|
251
261
|
from that location.
|
@@ -257,7 +267,8 @@ class SFTPHook(SSHHook):
|
|
257
267
|
conn.put(local_full_path, remote_full_path, confirm=confirm)
|
258
268
|
|
259
269
|
def delete_file(self, path: str) -> None:
|
260
|
-
"""
|
270
|
+
"""
|
271
|
+
Remove a file on the server.
|
261
272
|
|
262
273
|
:param path: full path to the remote file
|
263
274
|
"""
|
@@ -265,7 +276,8 @@ class SFTPHook(SSHHook):
|
|
265
276
|
conn.remove(path)
|
266
277
|
|
267
278
|
def get_mod_time(self, path: str) -> str:
|
268
|
-
"""
|
279
|
+
"""
|
280
|
+
Get an entry's modification time.
|
269
281
|
|
270
282
|
:param path: full path to the remote file
|
271
283
|
"""
|
@@ -274,7 +286,8 @@ class SFTPHook(SSHHook):
|
|
274
286
|
return datetime.datetime.fromtimestamp(ftp_mdtm).strftime("%Y%m%d%H%M%S") # type: ignore
|
275
287
|
|
276
288
|
def path_exists(self, path: str) -> bool:
|
277
|
-
"""
|
289
|
+
"""
|
290
|
+
Whether a remote entity exists.
|
278
291
|
|
279
292
|
:param path: full path to the remote file or directory
|
280
293
|
"""
|
@@ -287,7 +300,8 @@ class SFTPHook(SSHHook):
|
|
287
300
|
|
288
301
|
@staticmethod
|
289
302
|
def _is_path_match(path: str, prefix: str | None = None, delimiter: str | None = None) -> bool:
|
290
|
-
"""
|
303
|
+
"""
|
304
|
+
Whether given path starts with ``prefix`` (if set) and ends with ``delimiter`` (if set).
|
291
305
|
|
292
306
|
:param path: path to be checked
|
293
307
|
:param prefix: if set path will be checked is starting with prefix
|
@@ -308,7 +322,8 @@ class SFTPHook(SSHHook):
|
|
308
322
|
ucallback: Callable[[str], Any | None],
|
309
323
|
recurse: bool = True,
|
310
324
|
) -> None:
|
311
|
-
"""
|
325
|
+
"""
|
326
|
+
Recursively descend, depth first, the directory tree at ``path``.
|
312
327
|
|
313
328
|
This calls discrete callback functions for each regular file, directory,
|
314
329
|
and unknown file type.
|
@@ -346,7 +361,8 @@ class SFTPHook(SSHHook):
|
|
346
361
|
def get_tree_map(
|
347
362
|
self, path: str, prefix: str | None = None, delimiter: str | None = None
|
348
363
|
) -> tuple[list[str], list[str], list[str]]:
|
349
|
-
"""
|
364
|
+
"""
|
365
|
+
Get tuple with recursive lists of files, directories and unknown paths.
|
350
366
|
|
351
367
|
It is possible to filter results by giving prefix and/or delimiter parameters.
|
352
368
|
|
@@ -382,7 +398,8 @@ class SFTPHook(SSHHook):
|
|
382
398
|
return False, str(e)
|
383
399
|
|
384
400
|
def get_file_by_pattern(self, path, fnmatch_pattern) -> str:
|
385
|
-
"""
|
401
|
+
"""
|
402
|
+
Get the first matching file based on the given fnmatch type pattern.
|
386
403
|
|
387
404
|
:param path: path to be checked
|
388
405
|
:param fnmatch_pattern: The pattern that will be matched with `fnmatch`
|
@@ -395,7 +412,8 @@ class SFTPHook(SSHHook):
|
|
395
412
|
return ""
|
396
413
|
|
397
414
|
def get_files_by_pattern(self, path, fnmatch_pattern) -> list[str]:
|
398
|
-
"""
|
415
|
+
"""
|
416
|
+
Get all matching files based on the given fnmatch type pattern.
|
399
417
|
|
400
418
|
:param path: path to be checked
|
401
419
|
:param fnmatch_pattern: The pattern that will be matched with `fnmatch`
|
@@ -201,8 +201,7 @@ class SFTPOperator(BaseOperator):
|
|
201
201
|
input: file://<local_host>/path
|
202
202
|
output: file://<remote_host>:<remote_port>/path.
|
203
203
|
"""
|
204
|
-
from openlineage.
|
205
|
-
|
204
|
+
from airflow.providers.common.compat.openlineage.facet import Dataset
|
206
205
|
from airflow.providers.openlineage.extractors import OperatorLineage
|
207
206
|
|
208
207
|
scheme = "file"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: apache-airflow-providers-sftp
|
3
|
-
Version: 4.10.
|
3
|
+
Version: 4.10.3
|
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>
|
@@ -25,15 +25,17 @@ Requires-Dist: apache-airflow-providers-ssh>=2.1.0
|
|
25
25
|
Requires-Dist: apache-airflow>=2.7.0
|
26
26
|
Requires-Dist: asyncssh>=2.12.0
|
27
27
|
Requires-Dist: paramiko>=2.9.0
|
28
|
+
Requires-Dist: apache-airflow-providers-common-compat ; extra == "common.compat"
|
28
29
|
Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
|
29
30
|
Requires-Dist: apache-airflow-providers-ssh ; extra == "ssh"
|
30
31
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
31
|
-
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-sftp/4.10.
|
32
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-sftp/4.10.
|
32
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-sftp/4.10.3/changelog.html
|
33
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-sftp/4.10.3
|
33
34
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
34
35
|
Project-URL: Source Code, https://github.com/apache/airflow
|
35
36
|
Project-URL: Twitter, https://twitter.com/ApacheAirflow
|
36
37
|
Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
|
38
|
+
Provides-Extra: common.compat
|
37
39
|
Provides-Extra: openlineage
|
38
40
|
Provides-Extra: ssh
|
39
41
|
|
@@ -81,7 +83,7 @@ Provides-Extra: ssh
|
|
81
83
|
|
82
84
|
Package ``apache-airflow-providers-sftp``
|
83
85
|
|
84
|
-
Release: ``4.10.
|
86
|
+
Release: ``4.10.3``
|
85
87
|
|
86
88
|
|
87
89
|
`SSH File Transfer Protocol (SFTP) <https://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/>`__
|
@@ -94,7 +96,7 @@ This is a provider package for ``sftp`` provider. All classes for this provider
|
|
94
96
|
are in ``airflow.providers.sftp`` python package.
|
95
97
|
|
96
98
|
You can find package information and changelog for the provider
|
97
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-sftp/4.10.
|
99
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-sftp/4.10.3/>`_.
|
98
100
|
|
99
101
|
Installation
|
100
102
|
------------
|
@@ -127,15 +129,16 @@ You can install such cross-provider dependencies when installing from PyPI. For
|
|
127
129
|
|
128
130
|
.. code-block:: bash
|
129
131
|
|
130
|
-
pip install apache-airflow-providers-sftp[
|
132
|
+
pip install apache-airflow-providers-sftp[common.compat]
|
131
133
|
|
132
134
|
|
133
|
-
|
134
|
-
Dependent package
|
135
|
-
|
136
|
-
`apache-airflow-providers-
|
137
|
-
`apache-airflow-providers-
|
138
|
-
|
135
|
+
================================================================================================================== =================
|
136
|
+
Dependent package Extra
|
137
|
+
================================================================================================================== =================
|
138
|
+
`apache-airflow-providers-common-compat <https://airflow.apache.org/docs/apache-airflow-providers-common-compat>`_ ``common.compat``
|
139
|
+
`apache-airflow-providers-openlineage <https://airflow.apache.org/docs/apache-airflow-providers-openlineage>`_ ``openlineage``
|
140
|
+
`apache-airflow-providers-ssh <https://airflow.apache.org/docs/apache-airflow-providers-ssh>`_ ``ssh``
|
141
|
+
================================================================================================================== =================
|
139
142
|
|
140
143
|
The changelog for the provider package can be found in the
|
141
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-sftp/4.10.
|
144
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-sftp/4.10.3/changelog.html>`_.
|
@@ -1,18 +1,18 @@
|
|
1
1
|
airflow/providers/sftp/LICENSE,sha256=FFb4jd2AXnOOf7XLP04pQW6jbdhG49TxlGY6fFpCV1Y,13609
|
2
|
-
airflow/providers/sftp/__init__.py,sha256=
|
3
|
-
airflow/providers/sftp/get_provider_info.py,sha256=
|
2
|
+
airflow/providers/sftp/__init__.py,sha256=WcbcLb5hDStNcay0d2PcJ6STdBuuU4oI0v1m-fOBhl8,1492
|
3
|
+
airflow/providers/sftp/get_provider_info.py,sha256=NtaYYwjM6fjHCJy2CIhHU10UhKuXCnqZoQJx_OlTIJ8,4021
|
4
4
|
airflow/providers/sftp/decorators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
5
5
|
airflow/providers/sftp/decorators/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
6
6
|
airflow/providers/sftp/decorators/sensors/sftp.py,sha256=sgKMNvThkZt8MtJJH9QUnT3FdJlu18NAiTzRF08PFSY,2861
|
7
7
|
airflow/providers/sftp/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
8
|
-
airflow/providers/sftp/hooks/sftp.py,sha256=
|
8
|
+
airflow/providers/sftp/hooks/sftp.py,sha256=GJBuxow2aVWJpfCw3OwXpybGr4J1TPU7J7YOBjVUQ6M,22145
|
9
9
|
airflow/providers/sftp/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
10
|
-
airflow/providers/sftp/operators/sftp.py,sha256=
|
10
|
+
airflow/providers/sftp/operators/sftp.py,sha256=H9NIsfVaB3ISuGHqOcoLs7bBdQtkzU5WV_UB3HmQp3A,11534
|
11
11
|
airflow/providers/sftp/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
12
12
|
airflow/providers/sftp/sensors/sftp.py,sha256=L5nYm1wKpLCGystl7YGlKH_3m7d9J6QlQSSbV1aFIWE,8087
|
13
13
|
airflow/providers/sftp/triggers/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
14
14
|
airflow/providers/sftp/triggers/sftp.py,sha256=8CyIeW0h-BFJAcyDqW4YmlSq-Wr4fV-9sA5TquP4fTM,6155
|
15
|
-
apache_airflow_providers_sftp-4.10.
|
16
|
-
apache_airflow_providers_sftp-4.10.
|
17
|
-
apache_airflow_providers_sftp-4.10.
|
18
|
-
apache_airflow_providers_sftp-4.10.
|
15
|
+
apache_airflow_providers_sftp-4.10.3.dist-info/entry_points.txt,sha256=Fa1IkUHV6qnIuwLd0U7tKoklbLXXVrbB2hhG6N7Q-zo,100
|
16
|
+
apache_airflow_providers_sftp-4.10.3.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
17
|
+
apache_airflow_providers_sftp-4.10.3.dist-info/METADATA,sha256=TLK8Sp6tpUK2W798SDy6LyAp9xDbldml_61QSjM_3j4,6667
|
18
|
+
apache_airflow_providers_sftp-4.10.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|