Ctrl + K
DocumentationLog inGet started

tessl/pypi-apache-airflow-providers-ftp

tessl install tessl/pypi-apache-airflow-providers-ftp@3.13.0

Provider package for Apache Airflow that enables FTP file transfer protocol operations including hooks, operators, and sensors for workflow integration.

Agent Success

Agent success rate when using this tile

84%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.06x

Baseline

Agent success rate without this tile

79%

task.mdevals/scenario-1/

International FTP File Monitor

Build a file monitoring system for an Airflow DAG that watches for data files from international partners who use FTP servers with non-UTF-8 character encodings. The system must handle Cyrillic filenames (Windows-1251 encoding) from Eastern European partners and Latin-1 filenames (ISO-8859-1 encoding) from Western European partners.

Requirements

Your task is to implement an Airflow DAG that monitors two different FTP servers with different character encodings:

  1. Eastern European Partner: Monitor a file with a Cyrillic name отчет_данные.csv (translates to "report_data.csv") on an FTP server using Windows-1251 (cp1251) encoding
  2. Western European Partner: Monitor a file with Latin-1 characters données_françaises.csv (French for "french_data.csv") on an FTP server using ISO-8859-1 encoding

Both sensors should:

  • Use appropriate connection IDs: eastern_ftp and western_ftp for the respective servers
  • Have a poke interval of 60 seconds
  • Have a timeout of 300 seconds
  • Use poke mode for monitoring

The monitoring tasks should run in parallel (no dependencies between them).

@generates

Test Cases

  • Given an Airflow connection eastern_ftp configured with encoding cp1251 in extras, the sensor successfully detects the Cyrillic filename отчет_данные.csv when it exists on the FTP server @test
  • Given an Airflow connection western_ftp configured with encoding iso-8859-1 in extras, the sensor successfully detects the Latin-1 filename donnĂ©es_françaises.csv when it exists on the FTP server @test
  • The DAG contains exactly two sensor tasks that can run in parallel with no dependencies between them @test

API

from airflow import DAG
from datetime import datetime, timedelta

# Create the DAG named 'international_file_monitor'
# with a start_date of datetime(2024, 1, 1)
# and default_args including retries=1
dag = DAG(
    'international_file_monitor',
    start_date=datetime(2024, 1, 1),
    default_args={'retries': 1},
    schedule_interval=None,
)

# Define two sensor tasks for monitoring:
# 1. monitor_eastern_file - monitors 'отчет_данные.csv' using 'eastern_ftp' connection
# 2. monitor_western_file - monitors 'données_françaises.csv' using 'western_ftp' connection

Dependencies { .dependencies }

apache-airflow-providers-ftp { .dependency }

Provides FTP operations and sensors for Apache Airflow with support for custom character encodings.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/apache-airflow-providers-ftp@3.13.x
tile.json