-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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-5643] Reduce duplicated logic in S3Hook #6313
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6313 +/- ##
==========================================
+ Coverage 80.34% 80.35% +<.01%
==========================================
Files 616 616
Lines 35733 35724 -9
==========================================
- Hits 28711 28706 -5
+ Misses 7022 7018 -4
Continue to review full report at Codecov.
|
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.
Just my opinion: I rather create a private function that will be called in public functions. So that you do not rely on another public function (in case the public function gets changed).
Thank you both for your reviews. I agree with you @feluelle , I'll make the suggested changes |
S3Hook.load_bytes is duplicating the logic of S3Hook.load_file_obj. Instead, we should stay consistent : S3Hook.load_string is already delegating the logic to S3Hook.load_bytes, so we can use the same approach to delegate to S3Hook.load_file_obj
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 restarted the failed travis checks. |
If those are the kubernetes ones - maybe merge it without waiting. We have found with @gerardo a reason why kubernetes tests might timeout and we will fix it shortly - but I do not want to hold it back! |
Yeah the 2 failing tests are the k8s ones :/ |
Yes, Jarek I just saw the thread right after I reran the tests. I think we can merge it then. 👍 |
S3Hook.load_bytes is duplicating the logic of S3Hook.load_file_obj. Instead, we should stay consistent : S3Hook.load_string is already delegating the logic to S3Hook.load_bytes, so we can use the same approach to delegate to S3Hook.load_file_obj (cherry picked from commit ac42428)
S3Hook.load_bytes is duplicating the logic of S3Hook.load_file_obj. Instead, we should stay consistent : S3Hook.load_string is already delegating the logic to S3Hook.load_bytes, so we can use the same approach to delegate to S3Hook.load_file_obj (cherry picked from commit ac42428)
S3Hook.load_bytes is duplicating the logic of S3Hook.load_file_obj. Instead, we should stay consistent : S3Hook.load_string is already delegating the logic to S3Hook.load_bytes, so we can use the same approach to delegate to S3Hook.load_file_obj (cherry picked from commit ac42428)
S3Hook.load_bytes is duplicating the logic of S3Hook.load_file_obj. Instead, we should stay consistent : S3Hook.load_string is already delegating the logic to S3Hook.load_bytes, so we can use the same approach to delegate to S3Hook.load_file_obj (cherry picked from commit ac42428)
Jira
Description
load_bytes
is a convenience method that delegates toload_fileobj
, just likeload_string
delegates toload_bytes
. This change is here to make this logic more apparent.Tests
Commits
Documentation