Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for FTP as file location #1482

Merged
merged 20 commits into from
Jan 5, 2023
Merged

Support for FTP as file location #1482

merged 20 commits into from
Jan 5, 2023

Conversation

rajaths010494
Copy link
Contributor

@rajaths010494 rajaths010494 commented Dec 22, 2022

relates-to #969
Please describe the feature you'd like to see
It is a very common ETL operation to either push data to or load data from FTP sources

Describe the solution you'd like
FTP should be valid location types in File

Are there any alternatives to this feature?
Implementors otherwise need to use workarounds like S3toSFTPOperator

Acceptance Criteria

  • All checks and tests in the CI should pass
  • Unit tests (90% code coverage or more, once available)
  • Integration tests (if the feature relates to a new database or external service)
  • Example DAG
  • Docstrings in reStructuredText for each of methods, classes, functions and module-level attributes (including Example DAG on how it should be used)
  • Exception handling in case of errors
  • Logging (are we exposing useful information to the user? e.g. source and destination)
  • Improve the documentation (README, Sphinx, and any other relevant)
  • How to use Guide for the feature (example)

@codecov
Copy link

codecov bot commented Dec 22, 2022

Codecov Report

Base: 97.43% // Head: 93.16% // Decreases project coverage by -4.26% ⚠️

Coverage data is based on head (d490439) compared to base (d96861b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1482      +/-   ##
==========================================
- Coverage   97.43%   93.16%   -4.27%     
==========================================
  Files          21       65      +44     
  Lines         740     3481    +2741     
  Branches        0      418     +418     
==========================================
+ Hits          721     3243    +2522     
- Misses         19      157     +138     
- Partials        0       81      +81     
Impacted Files Coverage Δ
python-sdk/src/astro/files/base.py 100.00% <ø> (ø)
python-sdk/src/astro/constants.py 93.87% <100.00%> (ø)
python-sdk/src/astro/files/locations/ftp.py 100.00% <100.00%> (ø)
sql-cli/sql_cli/__init__.py
sql-cli/sql_cli/connections.py
sql-cli/sql_cli/dag_runner.py
sql-cli/sql_cli/cli/config.py
sql-cli/sql_cli/astro/utils.py
sql-cli/sql_cli/operators/load_file.py
sql-cli/sql_cli/workflow_directory_parser.py
... and 78 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rajaths010494 rajaths010494 marked this pull request as ready for review December 22, 2022 09:53
@rajaths010494 rajaths010494 changed the title FTP support file location Support for FTP as file location Dec 22, 2022
@utkarsharma2
Copy link
Collaborator

I think we should also support export_file() operator.

python-sdk/tests/files/locations/test_ftp.py Outdated Show resolved Hide resolved
python-sdk/tests/files/locations/test_ftp.py Outdated Show resolved Hide resolved
python-sdk/tests/files/locations/test_ftp.py Outdated Show resolved Hide resolved
python-sdk/tests/files/locations/test_ftp.py Outdated Show resolved Hide resolved
@sunank200
Copy link
Contributor

@rajaths010494 there should be tests for export file as well which are required to be added for FTP.

Copy link
Contributor

@pankajastro pankajastro left a comment

Choose a reason for hiding this comment

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

Are you planing to add some integration tests also?

.github/workflows/ci-python-sdk.yaml Outdated Show resolved Hide resolved
python-sdk/tests/files/locations/test_ftp.py Outdated Show resolved Hide resolved
python-sdk/tests/files/locations/test_ftp.py Outdated Show resolved Hide resolved
@rajaths010494
Copy link
Contributor Author

@rajaths010494 there should be tests for export file as well which are required to be added for FTP.

added integration test case for export and read the content and assert it

Copy link
Contributor

@pankajastro pankajastro left a comment

Choose a reason for hiding this comment

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

LGTM

@pankajastro pankajastro merged commit 193aee6 into main Jan 5, 2023
@pankajastro pankajastro deleted the ftp_location branch January 5, 2023 07:53
utkarsharma2 pushed a commit that referenced this pull request Jan 17, 2023
relates-to #969 
**Please describe the feature you'd like to see**
It is a very common ETL operation to either push data to or load data
from FTP sources

**Describe the solution you'd like**
FTP should be valid location types in `File`

**Are there any alternatives to this feature?**
Implementors otherwise need to use workarounds like `S3toSFTPOperator`

**Acceptance Criteria**

- [x] All checks and tests in the CI should pass
- [x] Unit tests (90% code coverage or more, [once
available](#191))
- [x] Integration tests (if the feature relates to a new database or
external service)
- [x] Example DAG
- [x] Docstrings in
[reStructuredText](https://peps.python.org/pep-0287/) for each of
methods, classes, functions and module-level attributes (including
Example DAG on how it should be used)
- [x] Exception handling in case of errors
- [x] Logging (are we exposing useful information to the user? e.g.
source and destination)
- [x] Improve the documentation (README, Sphinx, and any other relevant)
- [x] How to use Guide for the feature
([example](https://airflow.apache.org/docs/apache-airflow-providers-postgres/stable/operators/postgres_operator_howto_guide.html))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants