Skip to content

[AIRFLOW-4895] Import Iterable from collections.abc to fix DeprecationWarning in Python 3.7#5533

Merged
ashb merged 1 commit intoapache:masterfrom
tirkarthi:fix-collections-warning
Jul 4, 2019
Merged

[AIRFLOW-4895] Import Iterable from collections.abc to fix DeprecationWarning in Python 3.7#5533
ashb merged 1 commit intoapache:masterfrom
tirkarthi:fix-collections-warning

Conversation

@tirkarthi
Copy link
Contributor

Jira

  • My PR addresses the following Airflow Jira issues and references them in the PR title.

Description

Import Iterable from collections.abc to fix DeprecationWarning in Python 3.7. Use collections to ensure compatibility for Python 3.3 and below.

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

This fixes a DeprecationWarning and doesn't make code change

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 (not including Jira issue reference)
    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"

Code Quality

  • Passes flake8

# Fix Python > 3.7 deprecation
from collections.abc import Iterable
except ImportError:
# Preserve Python < 3.3 compatibility
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mimimum Python version we support is now 3.5 so I don't think we need this. (unless we also want to backport this to 1.10.x, where we still support py2.7)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it's also present in 1.10.x branch. The fix was based on https://issues.apache.org/jira/browse/AIRFLOW-3009 where similar problem was fixed in master and also seemed to be backported to 1.10.3.

@codecov-io
Copy link

codecov-io commented Jul 4, 2019

Codecov Report

Merging #5533 into master will decrease coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5533      +/-   ##
==========================================
- Coverage   79.07%   79.07%   -0.01%     
==========================================
  Files         489      489              
  Lines       30744    30747       +3     
==========================================
+ Hits        24312    24313       +1     
- Misses       6432     6434       +2
Impacted Files Coverage Δ
airflow/utils/helpers.py 82.58% <50%> (-0.98%) ⬇️

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 42033d2...25049c7. Read the comment docs.

@ashb ashb merged commit 977af46 into apache:master Jul 4, 2019
andriisoldatenko pushed a commit to andriisoldatenko/airflow that referenced this pull request Jul 26, 2019
wmorris75 pushed a commit to modmed-external/incubator-airflow that referenced this pull request Jul 29, 2019
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.

3 participants