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

Standardize imports. #10680

Merged
merged 1 commit into from
Apr 18, 2022
Merged

Conversation

bdice
Copy link
Contributor

@bdice bdice commented Apr 18, 2022

This PR standardizes a few imports across the cudf code base. Changes include:

  • Removed usage of some non-standard "two letter" names. For example, import numpy as np is common, but import pyorc as po and import fastavro as fa are non-standard and not the style used by their documentation. I left import cupy as cp, since both import cupy and import cupy as cp are prevalent in the code base (the one exception that I changed was a file that had both import cupy and import cupy as cp).
  • Avoid the pattern from some_package import x as x -- just write from some_package import x
  • Fixed some cimports
  • Always use import datetime instead of import datetime as dt to avoid conflicts with the many other dt names in our code (including local names that had the potential to shadow/overwrite the library's name)
  • Use warnings.warn rather than from warnings import warn for consistency across the library
  • Remove some legacy Python 2 compatibility

@bdice bdice added code quality Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Apr 18, 2022
@bdice bdice self-assigned this Apr 18, 2022
@codecov
Copy link

codecov bot commented Apr 18, 2022

Codecov Report

Merging #10680 (f56de9d) into branch-22.06 (94a5d41) will increase coverage by 0.02%.
The diff coverage is 90.47%.

@@               Coverage Diff                @@
##           branch-22.06   #10680      +/-   ##
================================================
+ Coverage         86.38%   86.41%   +0.02%     
================================================
  Files               142      142              
  Lines             22334    22334              
================================================
+ Hits              19294    19300       +6     
+ Misses             3040     3034       -6     
Impacted Files Coverage Δ
python/cudf/cudf/core/algorithms.py 90.47% <50.00%> (ø)
python/cudf/cudf/core/subword_tokenizer.py 75.00% <50.00%> (ø)
python/cudf/cudf/core/column/datetime.py 89.71% <100.00%> (ø)
python/cudf/cudf/core/column/decimal.py 91.09% <100.00%> (ø)
python/cudf/cudf/core/column/timedelta.py 90.75% <100.00%> (ø)
python/cudf/cudf/core/dataframe.py 93.75% <100.00%> (ø)
python/cudf/cudf/utils/dtypes.py 82.30% <100.00%> (ø)
python/cudf/cudf/utils/queryutils.py 94.28% <100.00%> (ø)
python/cudf/cudf/core/column/string.py 89.22% <0.00%> (+0.12%) ⬆️
python/cudf/cudf/core/groupby/groupby.py 91.72% <0.00%> (+0.22%) ⬆️
... and 2 more

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 94a5d41...f56de9d. Read the comment docs.

@bdice bdice marked this pull request as ready for review April 18, 2022 17:08
@bdice bdice requested a review from a team as a code owner April 18, 2022 17:08
@bdice bdice requested review from galipremsagar and isVoid April 18, 2022 17:08
Copy link
Contributor

@galipremsagar galipremsagar left a comment

Choose a reason for hiding this comment

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

@gpucibot merge

@galipremsagar
Copy link
Contributor

@gpucibot merge

@rapids-bot rapids-bot bot merged commit c322cba into rapidsai:branch-22.06 Apr 18, 2022
@bdice bdice deleted the improve-imports branch April 19, 2022 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants