hlakki31-arch opened a new issue, #54906:
URL: https://github.com/apache/airflow/issues/54906

   ### Description
   
   ### Proposal
   
   Add a `create_intermediate_dirs` parameter to `GCSToSFTPOperator`, similar 
to `SFTPOperator`, to allow skipping automatic directory creation.
   
   **Problem:**  
   Currently, `GCSToSFTPOperator` always calls `create_directory()` on the 
remote SFTP path, which can fail with permission errors when uploading to 
existing folders (e.g., `/landing_folder/`) where users don’t have permission 
to create new directories.
   
   **Proposed Solution:**  
   - Add a boolean parameter `create_intermediate_dirs` (default=True).  
   - When set to `False`, skip the `create_directory()` call and upload 
directly to the specified folder.  
   
   **Benefits:**  
   - Allows uploading to existing folders without needing to modify SFTP 
permissions.  
   - Matches behavior of `SFTPOperator`, making the API more consistent. 
   
   ### Use case/motivation
   
   The goal is to upload files from GCS to SFTP reliably even when the target 
folder exists and directory creation permissions are restricted. This prevents 
`PermissionError` failures and makes `GCSToSFTPOperator` more consistent with 
other SFTP operators.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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]

Reply via email to