astronomer.providers.sftp.sensors.sftp

Module Contents

Classes

SFTPSensorAsync

Polls an SFTP server continuously until a file_pattern is matched at a defined path

class astronomer.providers.sftp.sensors.sftp.SFTPSensorAsync(*, path, file_pattern='', timeout=None, **kwargs)[source]

Bases: airflow.providers.sftp.sensors.sftp.SFTPSensor

Polls an SFTP server continuously until a file_pattern is matched at a defined path

Parameters:
  • path (str) – The path on the SFTP server to search for a file matching the file pattern. Authentication method used in the SFTP connection must have access to this path

  • file_pattern (str) – Pattern to be used for matching against the list of files at the path above. Uses the fnmatch module from std library to perform the matching.

  • timeout (Optional[float]) – How long, in seconds, the sensor waits for successful before timing out

  • newer_than – DateTime for which the file or file path should be newer than, comparison is inclusive

execute(context)[source]

Logic that the sensor uses to correctly identify which trigger to execute, and defer execution as expected.

execute_complete(context, event=None)[source]

Callback for when the trigger fires - returns immediately. Relies on trigger to throw an exception, otherwise it assumes execution was successful.