Nataneljpwd commented on code in PR #52700:
URL: https://github.com/apache/airflow/pull/52700#discussion_r2293559693
##########
providers/sftp/src/airflow/providers/sftp/sensors/sftp.py:
##########
@@ -136,6 +137,19 @@ def poke(self, context: Context) -> PokeReturnValue | bool:
else:
files_found = actual_files_present
+ return files_found
+
+ def poke(self, context: Context) -> PokeReturnValue | bool:
+ self.hook = SFTPHook(self.sftp_conn_id,
use_managed_conn=self.use_managed_conn)
+
+ self.log.info("Poking for %s, with pattern %s", self.path,
self.file_pattern)
+
+ if self.use_managed_conn:
Review Comment:
I don't think so, as the decorator is made for the hook and not the sensor,
it would require a change to the decorator and it would also be not as simple
IMO, as then a person needs to look at the decorator as well as the code
itself, here its just a simple if and it also contains additional logic which
the decorator might break.
If you think that it should be used here, let me know.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]