-
Notifications
You must be signed in to change notification settings - Fork 16.4k
[AIRFLOW-3602] Improve ImapHook handling of retrieving no attachments #4475
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-3602] Improve ImapHook handling of retrieving no attachments #4475
Conversation
|
PTAL @kaxil I would really like to have this in 1.10.2 if possible. Or what do you actually think of this PR? |
|
I think we can raise a warning but we shouldn't raise an exception. |
|
But then the task won't fail if there is no attachment. |
|
It is similar to the S3Hook if you want to download a file from s3 you get an exception when there isn't a file with the given name. I think the same goes for a mail server and downloading its mail attachments. If you want to be sure that there is an attachment with the given name you can run a sensor task ( |
6db3ac7 to
d48a96b
Compare
Codecov Report
@@ Coverage Diff @@
## master #4475 +/- ##
==========================================
+ Coverage 11.03% 74.03% +63%
==========================================
Files 421 421
Lines 27652 27656 +4
==========================================
+ Hits 3051 20475 +17424
+ Misses 24601 7181 -17420
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #4475 +/- ##
==========================================
+ Coverage 73.54% 74.14% +0.59%
==========================================
Files 421 421
Lines 27724 27736 +12
==========================================
+ Hits 20389 20564 +175
+ Misses 7335 7172 -163
Continue to review full report at Codecov.
|
|
My first though is that the Hook should probably just return The S3 case is different - getting the attachments of a message is closer to listing keys (which doesn't throw any exceptions, it returns an empty list) than getting a specific file. |
Is it really? But the |
$ mkdir tmp
$ ls tmp/
$ echo $?
0 |
2b4e682 to
93bbc1c
Compare
93bbc1c to
ef43c4f
Compare
- fixes escaping chars and symlink tests not testing correctly - adds note for handling symlinks [AIRFLOW-3602] Changes ImapHook handling of retrieving no attachments NOTE: You can now specify what should happen when retrieving or downloading a non-existing mail attachment - update docs and remove unnecessary default value descriptions - reformatting [AIRFLOW-3602] Add silent mode
ef43c4f to
764d3a0
Compare
|
Waiting for green tests then will merge |
|
Thanks @feluelle |
Make sure you have checked all steps below.
Jira
Description
This PR changes the ImapHook so it will fail when no attachments have been found.
It also:
Tests
Commits
Documentation
Code Quality
flake8