-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Add FTPFileTransmitOperator
#26974
Add FTPFileTransmitOperator
#26974
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
Connection( | ||
conn_id="ftp_default", | ||
conn_type="ftp", | ||
host="localhost", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an ftp_default connection, as it previously did not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though the unit tests no longer use a local FTP Server, I still think that having this FTP Default connection would be useful, as without this, defining the following piece of code will throw an error indicating that the "connection with id 'ftp_default' does not exist": hook = FTPHook()
338b93f
to
1b9741f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation would be awesome too :)
8f9f3fb
to
da4a16c
Compare
Exactly :) |
38ed8db
to
bdd1d6b
Compare
bdd1d6b
to
f7ea904
Compare
493cca5
to
11a191e
Compare
@RachitSharma2001 - How about changing to AIP-47 and rebasing that one ? |
@potiuk Sorry for late reply, got back from vacation today. That sounds good, I will change to AIP-47 and rebase. |
create_intermediate_dirs=True, | ||
) | ||
# [END howto_operator_ftp_get] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you don't have any teardown tasks here, but I'd prefer that you still add the watcher task and a task chain, just to match other AIP-47 spec tests and so that future additions are more straightforward
Some checks also failed, do you mind re-running them @RachitSharma2001 (rebasing your branch will do it) |
Yep. I woudl have rebased myself, but there are conflicts (so you need to rebase abway @RachitSharma2001 |
fb8b04f
to
ad497ce
Compare
6c47bff
to
b6d4b28
Compare
@potiuk @o-nikolas I have added the requested changes and updated my branch. Let me know if the current changes look good and if there is anything else I should add. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good!
Though your build is failing due to the infamous:
The hosted runner: GitHub Actions 209 lost communication with the server. Anything in your workflow that terminates the runner process, starves it for CPU/Memory, or blocks its network access can cause this error.
I was hitting this in some of my PRs lately too. I did a bunch of deep dive but was not able to come up with a RCA. Try rebasing form main a few times to see if you can get a pass.
@o-nikolas Thank you! Although, it seems that the tests were reran and now all the tests are passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NICE!. I know @eladkal had previously a doubt whether those shoudl not be local_to or _to_local set of transfer operators, but I personaly do not see the need for consistency (and I consider the local_*
a bit strange now when I think of it.
WDYT Everyone.?
I don't feel too strongly either way, I'm personally happy with the current name 👍 |
Consistency is important. Many users are using multiple providers lack of consistency affects development velocity as you always need to look up how specific provider/service name things. If all use same convention then you don't need to look it up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
thank you @RachitSharma2001
Awesome work, congrats on your first merged pull request! |
This was a race of merging PR apache#26974 and apache#28090
The corresponding issue: #26531
I have added the
FTPOperator
, which allows for writing to files in FTP and downloading them to the local directory.I have also added tests in the tests/providers/ftp/operators directory. In addition, I modified the scripts/docker/entrypoint_ci.sh file to pull up a local FTP server in ci in order to perform these tests. I have made sure to follow the suggested format for adding new airflow operators from here.
After this PR is approved and merged, I will add the
FTPSOperator
as well.