-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Closed
Labels
Description
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 thecreate_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?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable