-
Notifications
You must be signed in to change notification settings - Fork 16.4k
[AIRFLOW-3552] Add ImapAttachmetToS3Operator #4476
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
[AIRFLOW-3552] Add ImapAttachmetToS3Operator #4476
Conversation
|
Especially because of this:
I am thinking of changing this so that you can transfer multiple attachments that for example match the regular expression you pass in but I don't know if this is really a good idea and if so how would be the best way to implement this. Something like adding |
Fokko
left a comment
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.
Thanks @feluelle
Looking good, but I have some minor comments. PTAL
775e108 to
b146d14
Compare
Codecov Report
@@ Coverage Diff @@
## master #4476 +/- ##
==========================================
+ Coverage 74.76% 74.78% +0.02%
==========================================
Files 429 430 +1
Lines 29648 29670 +22
==========================================
+ Hits 22165 22189 +24
+ Misses 7483 7481 -2
Continue to review full report at Codecov.
|
|
@Fokko resolved and also added template fields. |
|
Is there a naming policy ? However there are two definition Without With It's very confusing. |
|
Most things have with (Edit: meant to say with operator) |
|
@ashb Actually most with Operator. Actually there is a 3rd kind I think there should be specific rules for this in |
|
@OmerJog Absolutly agree. I don't like how this is currently done, too. |
|
I'm not on mailing list that usually too spamy for me. Just thought it's worth mentioning |
ashb
left a comment
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.
From the class name I wouldn't have expeceted this to be about attacmhents, but just the message. Maybe ImapAttachmentToS3TransferOperator is a little bit long ImapAttachmentToS3Operator
If the sole purpose of this operator is to transfer attachments, then failing when there are none probably makes sense.
b146d14 to
b4de8ea
Compare
NOTE: This operator only transfers the latest attachment by name. - adds tests [AIRFLOW-3552] Add ImapToS3TransferOperator - add missing template fields - add missing apply_defaults decorator - change s3_conn_id to default to aws_default connection id [AIRFLOW-3602] Rename class and its references [AIRFLOW-3602] Fix imap_to_s3 test class
b4de8ea to
e6f8492
Compare
|
Hey @ashb, I changed the class name. Any other comments about this feature? :) |
ashb
left a comment
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.
Not a comment on this PR, more a general observation:
I'd like to find a way to make this sort of XToYOperator more generic.
Something like:
CopyOperator(
source=ImapAttachmentSomething(imap_conn_id...),
dest=S3Fs(....)
)
Very half baked idea, but supporting arbitrary sources and dests would be nice.
|
@ashb I understand your idea, but I don't think this can't be more generic. It won't get simpler. What I have done in for our custom airflow plugin is adding kinda like an interface: So all transfer operators need to have two connections. |
|
@ashb |
NOTE: This operator only transfers the latest attachment by name.
NOTE: This operator only transfers the latest attachment by name.
Make sure you have checked all steps below.
Jira
Description
This PR adds an operator that transfers a mail attachment into an s3 bucket.
It also:
NOTE: This operator only transfers the latest attachment by name.
Tests
Commits
Documentation
Code Quality
flake8