tessl install tessl/pypi-apache-airflow-providers-ftp@3.13.0Provider 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%
Build a system that transfers multiple daily report files from a local directory to a remote FTP server in a single operation.
Your task is to implement a function that uploads multiple report files to a remote FTP server. The system should:
Implement a function distribute_reports that:
Given local files ["/tmp/report1.csv", "/tmp/report2.csv"] and remote paths ["/reports/daily/report1.csv", "/reports/daily/report2.csv"], the function uploads both files to the remote server @test
Given local files ["/tmp/data.txt"] and remote paths ["/archive/2024/01/data.txt"] where the remote directory /archive/2024/01/ doesn't exist, the function creates the necessary directories and uploads the file successfully @test
Given mismatched list lengths (e.g., 3 local files but 2 remote paths), the function raises an appropriate error @test
@generates
def distribute_reports(
ftp_conn_id: str,
local_filepaths: list[str],
remote_filepaths: list[str]
) -> list[str]:
"""
Distributes multiple report files to a remote FTP server in a batch operation.
Args:
ftp_conn_id: The Airflow connection ID for the FTP server
local_filepaths: List of local file paths to upload
remote_filepaths: List of corresponding remote destination paths
Returns:
List of remote file paths that were uploaded
Raises:
ValueError: If the lengths of local_filepaths and remote_filepaths don't match
"""
passProvides FTP operations support for Apache Airflow.