Skip to content

Streaming option in SFTPToGCSOperator#48107

Merged
potiuk merged 1 commit into
apache:mainfrom
kkulczak:streaming-option-in-gcs-to-gcs-operator
Apr 1, 2025
Merged

Streaming option in SFTPToGCSOperator#48107
potiuk merged 1 commit into
apache:mainfrom
kkulczak:streaming-option-in-gcs-to-gcs-operator

Conversation

@kkulczak

@kkulczak kkulczak commented Mar 23, 2025

Copy link
Copy Markdown
Contributor

SFTPToGCSOperator always copy files into Airflow worker disk and later uploads them into GCS.
This change enables to use streaming from SFTP directly to GCS, reducing need for disk space to store large files.

As Google Cloud Consulting member I would need this feature for one of my customer projects.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Mar 23, 2025
@kkulczak
kkulczak force-pushed the streaming-option-in-gcs-to-gcs-operator branch 3 times, most recently from 56d3656 to 752dc79 Compare March 23, 2025 06:24
Comment thread providers/google/src/airflow/providers/google/cloud/transfers/sftp_to_gcs.py Outdated
Comment thread providers/google/src/airflow/providers/google/cloud/transfers/sftp_to_gcs.py Outdated
Comment thread providers/google/tests/unit/google/cloud/transfers/test_sftp_to_gcs.py Outdated
@kkulczak
kkulczak force-pushed the streaming-option-in-gcs-to-gcs-operator branch 2 times, most recently from 821b63c to c8a756d Compare March 27, 2025 15:12
Comment thread providers/google/src/airflow/providers/google/cloud/transfers/sftp_to_gcs.py Outdated
@kkulczak
kkulczak force-pushed the streaming-option-in-gcs-to-gcs-operator branch from c8a756d to 747c23f Compare March 28, 2025 11:32
@kkulczak

Copy link
Copy Markdown
Contributor Author

Please check latest verison and run CI/CD if acceptable

@potiuk

potiuk commented Mar 31, 2025

Copy link
Copy Markdown
Member

Nice. Let's see if the tests pass.

@potiuk

potiuk commented Mar 31, 2025

Copy link
Copy Markdown
Member

Things to fix

@kkulczak
kkulczak force-pushed the streaming-option-in-gcs-to-gcs-operator branch 2 times, most recently from 4cbf627 to ea7f8bb Compare March 31, 2025 08:50
@kkulczak

Copy link
Copy Markdown
Contributor Author

I struggle a bit with understanding pipeline results.

I found 3 problems:

  • trailing-space by precommit: fixed in latest push
  • docs-spelling: I don't see error message in pipeline logs which would suggest what the problem actually is. When I tried to run those scripts in GitHub codespace I've encountered import errors.
  • Unit-tests: I don't see any providers-google relegated errors. I see problems with dependencies installation, but I did not make changes to those.

Could you help me to understand what else I'm supposed to fix?

@potiuk

potiuk commented Mar 31, 2025

Copy link
Copy Markdown
Member

You have duplicated test - see the output of static tests. I think all else is coming from that

@kkulczak
kkulczak force-pushed the streaming-option-in-gcs-to-gcs-operator branch from ea7f8bb to 3d35ad4 Compare March 31, 2025 11:48
@kkulczak

Copy link
Copy Markdown
Contributor Author

I'm really sorry, but I don't understand the error from documentation build.
Especially with the fact that I did not modify it.

@ashb ashb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These suggestions might fix the docs build

Comment thread providers/google/src/airflow/providers/google/cloud/hooks/gcs.py Outdated
Comment thread providers/google/src/airflow/providers/google/cloud/transfers/sftp_to_gcs.py Outdated
@kkulczak

kkulczak commented Apr 1, 2025

Copy link
Copy Markdown
Contributor Author

@ashb unfortunately ci/CD still failing

@ashb

ashb commented Apr 1, 2025

Copy link
Copy Markdown
Member

============================== apache-airflow-providers-google ==============================
------------------------------ Error   1 --------------------
 ERROR: Unexpected indentation.

File path: apache-airflow-providers-google/_api/airflow/providers/google/cloud/transfers/sftp_to_gcs/index.rst (76)
------------------------------ Error   2 --------------------
 WARNING: Block quote ends without a blank line; unexpected unindent.

File path: apache-airflow-providers-google/_api/airflow/providers/google/cloud/transfers/sftp_to_gcs/index.rst (77)

Those are the errors. Matching those to source lines is tricky sadly, but using the command @potiuk gave you in Slack should help iterate on fixing it.

This example might help https://github.com/sphinx-doc/sphinx/issues/2768#issuecomment-233096479 (code to avoid needlessly linking issues)

   :param opt: Table creation option. Take the following values:

      * ``'exact'`` - create table from exact csv file.
      * ``'foo'`` - create FooTable from foo8 file.
      * ``'bar'`` - create BarTable from bar8 file.
      * ``'baz'`` - create or update partial table from columns.
      * ``'qaz'`` - add bar values to FooTable

   :type opt: ``str``

@molcay molcay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kkulczak,
Thank you for the contribution 👍🏼

I put some nit-picking comments to follow the convention of the Google provider, please have a look and let me know :)

Comment thread providers/google/src/airflow/providers/google/cloud/hooks/gcs.py
@potiuk

potiuk commented Apr 1, 2025

Copy link
Copy Markdown
Member

Those are the errors. Matching those to source lines is tricky sadly, but using the command @potiuk gave you in Slack should help iterate on fixing it.

Yeah. With #48223 I am aiming to simplify it and make iteration on docs way faster (there will be followup to #48223 with more detailed instructions and guidelines. And doc building should work consistently with localvenv, breeze command and codespaces then.

@kkulczak
kkulczak force-pushed the streaming-option-in-gcs-to-gcs-operator branch from 504b3b7 to a5387a9 Compare April 1, 2025 16:45
@kkulczak

kkulczak commented Apr 1, 2025

Copy link
Copy Markdown
Contributor Author

@potiuk Ready to be merged from my point of view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants