apache-airflow-providers-sftp 5.3.0rc1__py3-none-any.whl → 5.3.1__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.0"
32
+ __version__ = "5.3.1"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.10.0"
@@ -89,25 +89,25 @@ class SFTPSensor(BaseSensorOperator):
89
89
  if self.file_pattern:
90
90
  files_from_pattern = self.hook.get_files_by_pattern(self.path, self.file_pattern)
91
91
  if files_from_pattern:
92
- actual_files_to_check = [
92
+ actual_files_present = [
93
93
  os.path.join(self.path, file_from_pattern) for file_from_pattern in files_from_pattern
94
94
  ]
95
95
  else:
96
96
  return False
97
97
  else:
98
98
  try:
99
- self.hook.isfile(self.path)
100
- actual_files_to_check = [self.path]
101
- except OSError as e:
102
- if e.errno != SFTP_NO_SUCH_FILE:
103
- raise AirflowException from e
104
- actual_files_to_check = []
99
+ # If a file is present, it is the single element added to the actual_files_present list to be
100
+ # processed. If the file is a directory, actual_file_present will be assigned an empty list,
101
+ # since SFTPHook.isfile(...) returns False
102
+ actual_files_present = [self.path] if self.hook.isfile(self.path) else []
103
+ except Exception as e:
104
+ raise AirflowException from e
105
105
 
106
106
  if self.newer_than:
107
- for actual_file_to_check in actual_files_to_check:
107
+ for actual_file_present in actual_files_present:
108
108
  try:
109
- mod_time = self.hook.get_mod_time(actual_file_to_check)
110
- self.log.info("Found File %s last modified: %s", actual_file_to_check, mod_time)
109
+ mod_time = self.hook.get_mod_time(actual_file_present)
110
+ self.log.info("Found File %s last modified: %s", actual_file_present, mod_time)
111
111
  except OSError as e:
112
112
  if e.errno != SFTP_NO_SUCH_FILE:
113
113
  raise AirflowException from e
@@ -118,22 +118,22 @@ class SFTPSensor(BaseSensorOperator):
118
118
  _mod_time = convert_to_utc(datetime.strptime(mod_time, "%Y%m%d%H%M%S"))
119
119
  _newer_than = convert_to_utc(self.newer_than)
120
120
  if _newer_than <= _mod_time:
121
- files_found.append(actual_file_to_check)
121
+ files_found.append(actual_file_present)
122
122
  self.log.info(
123
123
  "File %s has modification time: '%s', which is newer than: '%s'",
124
- actual_file_to_check,
124
+ actual_file_present,
125
125
  str(_mod_time),
126
126
  str(_newer_than),
127
127
  )
128
128
  else:
129
129
  self.log.info(
130
130
  "File %s has modification time: '%s', which is older than: '%s'",
131
- actual_file_to_check,
131
+ actual_file_present,
132
132
  str(_mod_time),
133
133
  str(_newer_than),
134
134
  )
135
135
  else:
136
- files_found = actual_files_to_check
136
+ files_found = actual_files_present
137
137
 
138
138
  if not len(files_found):
139
139
  return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-sftp
3
- Version: 5.3.0rc1
3
+ Version: 5.3.1
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>
@@ -20,15 +20,15 @@ Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Topic :: System :: Monitoring
23
- Requires-Dist: apache-airflow>=2.10.0rc1
24
- Requires-Dist: apache-airflow-providers-ssh>=2.1.0rc1
23
+ Requires-Dist: apache-airflow>=2.10.0
24
+ Requires-Dist: apache-airflow-providers-ssh>=2.1.0
25
25
  Requires-Dist: paramiko>=2.9.0
26
26
  Requires-Dist: asyncssh>=2.12.0
27
27
  Requires-Dist: apache-airflow-providers-common-compat ; extra == "common-compat"
28
28
  Requires-Dist: apache-airflow-providers-openlineage ; extra == "openlineage"
29
29
  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.3.0/changelog.html
31
- Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-sftp/5.3.0
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
32
32
  Project-URL: Mastodon, https://fosstodon.org/@airflow
33
33
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
34
34
  Project-URL: Source Code, https://github.com/apache/airflow
@@ -61,7 +61,7 @@ Provides-Extra: openlineage
61
61
 
62
62
  Package ``apache-airflow-providers-sftp``
63
63
 
64
- Release: ``5.3.0``
64
+ Release: ``5.3.1``
65
65
 
66
66
 
67
67
  `SSH File Transfer Protocol (SFTP) <https://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/>`__
@@ -74,7 +74,7 @@ This is a provider package for ``sftp`` provider. All classes for this provider
74
74
  are in ``airflow.providers.sftp`` python package.
75
75
 
76
76
  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.0/>`_.
77
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.1/>`_.
78
78
 
79
79
  Installation
80
80
  ------------
@@ -119,5 +119,5 @@ Dependent package
119
119
  ================================================================================================================== =================
120
120
 
121
121
  The changelog for the provider package can be found in the
122
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.0/changelog.html>`_.
122
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-sftp/5.3.1/changelog.html>`_.
123
123
 
@@ -1,5 +1,5 @@
1
1
  airflow/providers/sftp/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
2
- airflow/providers/sftp/__init__.py,sha256=NlFJT2B_4gf_vI6L6IzQrw4SNQF1hI707McQK7IBcS0,1493
2
+ airflow/providers/sftp/__init__.py,sha256=Xjl4kCKRbGICEs9flkeiTlIpHIGlgWUW_bfu78Dhprs,1493
3
3
  airflow/providers/sftp/get_provider_info.py,sha256=_IqUGQ-rKpZsSAsXdTsGYzfzJ3X57duhn-2b0-rFOz0,2905
4
4
  airflow/providers/sftp/version_compat.py,sha256=j5PCtXvZ71aBjixu-EFTNtVDPsngzzs7os0ZQDgFVDk,1536
5
5
  airflow/providers/sftp/decorators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
@@ -10,10 +10,10 @@ airflow/providers/sftp/hooks/sftp.py,sha256=r80l3jTYVzvXZF2hVpHWQ1aeY_Uy127EEVqG
10
10
  airflow/providers/sftp/operators/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
11
11
  airflow/providers/sftp/operators/sftp.py,sha256=WSHPIGLUZD62knz_uBweVfMIi4tqMCDmUHBl9umKrbY,12940
12
12
  airflow/providers/sftp/sensors/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
13
- airflow/providers/sftp/sensors/sftp.py,sha256=WpotlHzsWRgtJnu44zEKU3hagKT1J634M-jQYvQ9Z3M,8301
13
+ airflow/providers/sftp/sensors/sftp.py,sha256=1xku3zJmBQ1aeh2pTb4U_A7OXSCEQ_A_aiNBb2F1cr8,8470
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.0rc1.dist-info/entry_points.txt,sha256=Fa1IkUHV6qnIuwLd0U7tKoklbLXXVrbB2hhG6N7Q-zo,100
17
- apache_airflow_providers_sftp-5.3.0rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
18
- apache_airflow_providers_sftp-5.3.0rc1.dist-info/METADATA,sha256=uEwyA0O86_nbxdI2EO7PCuui1ObfaLAfBUxnN30oM1g,5702
19
- apache_airflow_providers_sftp-5.3.0rc1.dist-info/RECORD,,
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,,