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

[AIRFLOW-1797] S3Hook.load_string didn't work on Python3 #2771

Closed
wants to merge 1 commit into from

Conversation

ashb
Copy link
Member

@ashb ashb commented Nov 9, 2017

Dear Airflow maintainers,

Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!

JIRA

Description

Tests

  • My PR adds the following unit tests: New tests/hooks/test_s3_hook.py file covering load_string and read_key. Moved one existing test out of tests/core.py

Commits

  • My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

With the switch to Boto3 we now need the content to be bytes, not a
string. On Python2 there is no difference, but for Python3 this matters.

And since there were no real tests covering the S3Hook I've added some
basic ones.
@codecov-io
Copy link

Codecov Report

Merging #2771 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2771      +/-   ##
==========================================
+ Coverage   73.26%   73.31%   +0.05%     
==========================================
  Files         157      157              
  Lines       11934    11934              
==========================================
+ Hits         8744     8750       +6     
+ Misses       3190     3184       -6
Impacted Files Coverage Δ
airflow/hooks/S3_hook.py 51.19% <100%> (+20.23%) ⬆️
airflow/task_runner/bash_task_runner.py 93.33% <0%> (-6.67%) ⬇️
airflow/utils/helpers.py 53.44% <0%> (-2.88%) ⬇️
airflow/jobs.py 79.23% <0%> (-0.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3eb2dd8...771ced3. Read the comment docs.

asfgit pushed a commit that referenced this pull request Nov 9, 2017
With the switch to Boto3 we now need the content
to be bytes, not a
string. On Python2 there is no difference, but for
Python3 this matters.

And since there were no real tests covering the
S3Hook I've added some
basic ones.

Closes #2771 from ashb/AIRFLOW-1797

(cherry picked from commit 28411b1)
Signed-off-by: Bolke de Bruin <[email protected]>
@asfgit asfgit closed this in 28411b1 Nov 9, 2017
asfgit pushed a commit that referenced this pull request Nov 9, 2017
With the switch to Boto3 we now need the content
to be bytes, not a
string. On Python2 there is no difference, but for
Python3 this matters.

And since there were no real tests covering the
S3Hook I've added some
basic ones.

Closes #2771 from ashb/AIRFLOW-1797

(cherry picked from commit 28411b1)
Signed-off-by: Bolke de Bruin <[email protected]>
@ashb ashb deleted the AIRFLOW-1797 branch November 9, 2017 20:16
Acehaidrey pushed a commit to Acehaidrey/incubator-airflow that referenced this pull request Jan 19, 2018
With the switch to Boto3 we now need the content
to be bytes, not a
string. On Python2 there is no difference, but for
Python3 this matters.

And since there were no real tests covering the
S3Hook I've added some
basic ones.

Closes apache#2771 from ashb/AIRFLOW-1797
stlava pushed a commit to Nextdoor/airflow that referenced this pull request Sep 4, 2019
With the switch to Boto3 we now need the content
to be bytes, not a
string. On Python2 there is no difference, but for
Python3 this matters.

And since there were no real tests covering the
S3Hook I've added some
basic ones.

Closes apache#2771 from ashb/AIRFLOW-1797
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.

2 participants