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

Partialy fix issue #23334 - isort pandas/core/dtypes directory #23336

Merged
merged 12 commits into from
Oct 31, 2018

Conversation

alexander-ponomaroff
Copy link
Contributor

@alexander-ponomaroff alexander-ponomaroff commented Oct 25, 2018

The imports have been sorted with isort in the pandas/core/dtypes directory.

Moving onto sorting the pandas/core/groupby directory.

@pep8speaks
Copy link

pep8speaks commented Oct 25, 2018

Hello @alexander-ponomaroff! Thanks for updating the PR.

Comment last updated on October 25, 2018 at 21:04 Hours UTC

@alimcmaster1
Copy link
Member

Thanks @alexander-ponomaroff ! Lets wait for CI to run then i'm happy to review this.

@alexander-ponomaroff
Copy link
Contributor Author

Thank you @alimcmaster1 . Could you please explain what "passes git diff upstream/master -u -- "*.py" | flake8 --diff" means? I noticed that you have this checked in your pull requests.

@alimcmaster1
Copy link
Member

Hey - please see the "Python (PEP8)" section in the contributing guide and further info on flake8 here - hope that helps.

@alexander-ponomaroff
Copy link
Contributor Author

@alimcmaster1 How long does the CI usually run for? I would like to wait for the dtypes directory to be all good before starting to work on the groupby directory, but might need to leave soon for a couple hours. So I was wondering it the checks will finish before I have to leave.

@alexander-ponomaroff
Copy link
Contributor Author

Hey - please see the "Python (PEP8)" section in the contributing guide and further info on flake8 here - hope that helps.

Thanks, just performed the check locally. But I'm assuming the pep8speaks bot, which is the second comment of this pr does the same thing here?

@alimcmaster1
Copy link
Member

https://travis-ci.org/pandas-dev/pandas/pull_requests , you can look at the CI run off the back of previous PRs to get an idea of how long it will take, feel free to wait till tomorrow there is no rush

@codecov
Copy link

codecov bot commented Oct 25, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@0d6cb3c). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #23336   +/-   ##
=========================================
  Coverage          ?   92.18%           
=========================================
  Files             ?      161           
  Lines             ?    51186           
  Branches          ?        0           
=========================================
  Hits              ?    47188           
  Misses            ?     3998           
  Partials          ?        0
Flag Coverage Δ
#multiple 90.62% <100%> (?)
#single 42.22% <100%> (?)
Impacted Files Coverage Δ
pandas/core/dtypes/base.py 100% <100%> (ø)
pandas/core/dtypes/concat.py 96.34% <100%> (ø)
pandas/core/dtypes/missing.py 93.1% <100%> (ø)
pandas/core/dtypes/dtypes.py 95.61% <100%> (ø)
pandas/core/dtypes/inference.py 98.38% <100%> (ø)
pandas/core/dtypes/cast.py 88.92% <100%> (ø)
pandas/core/dtypes/common.py 94.37% <100%> (ø)
pandas/core/dtypes/api.py 100% <100%> (ø)

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 0d6cb3c...a74f2b6. Read the comment docs.

@jreback jreback added the Code Style Code style, linting, code_checks label Oct 26, 2018
@jreback jreback added this to the 0.24.0 milestone Oct 26, 2018
@jreback
Copy link
Contributor

jreback commented Oct 26, 2018

pls merge master and ping on green.

@alimcmaster1
Copy link
Member

from pandas.core.dtypes.generic import ABCPeriodArray in common.py it looks like you have removed this import? Did isort do this?

@alexander-ponomaroff
Copy link
Contributor Author

@alimcmaster1 Not sure what happened, I did not remove it on purpose.

@alexander-ponomaroff
Copy link
Contributor Author

@alimcmaster1 I just added ABCPeriodArray back and fixed another conflict.

@thoo
Copy link
Contributor

thoo commented Oct 26, 2018

@alexander-ponomaroff You might want to rerun isort to fix travis CI. I did on some of my PRs and they are passed now. It might be due to upstream/merge.

@alexander-ponomaroff
Copy link
Contributor Author

@thoo I reran isort, but the CI is still failing. @alimcmaster1 Do you have any suggestions on what I should do?

@thoo
Copy link
Contributor

thoo commented Oct 26, 2018

You can go to the log file and see what goes wrong. For example, this is the first one failed.

�[31m�[1m_____________ TestDataFrameCombineFirst.test_combine_first_period ______________�[0m
[gw1] linux -- Python 3.7.1 /home/travis/miniconda3/envs/pandas/bin/python

self = <pandas.tests.frame.test_combine_concat.TestDataFrameCombineFirst object at 0x7f06cdf74470>

�[1m    def test_combine_first_period(self):�[0m
�[1m        data1 = pd.PeriodIndex(['2011-01', 'NaT', '2011-03',�[0m
�[1m                                '2011-04'], freq='M')�[0m
�[1m        df1 = pd.DataFrame({'P': data1}, index=[1, 3, 5, 7])�[0m
�[1m        data2 = pd.PeriodIndex(['2012-01-01', '2012-02',�[0m
�[1m                                '2012-03'], freq='M')�[0m
�[1m        df2 = pd.DataFrame({'P': data2}, index=[2, 4, 5])�[0m
�[1m    �[0m
�[1m        res = df1.combine_first(df2)�[0m
�[1m        exp_dts = pd.PeriodIndex(['2011-01', '2012-01', 'NaT',�[0m
�[1m                                  '2012-02', '2011-03', '2011-04'],�[0m
�[1m                                 freq='M')�[0m
�[1m        exp = pd.DataFrame({'P': exp_dts}, index=[1, 2, 3, 4, 5, 7])�[0m
�[1m>       tm.assert_frame_equal(res, exp)�[0m
�[1m�[31mE       AssertionError: Attributes are different�[0m
�[1m�[31mE       �[0m
�[1m�[31mE       Attribute "dtype" are different�[0m
�[1m�[31mE       [left]:  int64�[0m
�[1m�[31mE       [right]: period[M]�[0m

�[1m�[31mpandas/tests/frame/test_combine_concat.py�[0m:775: AssertionError

@thoo
Copy link
Contributor

thoo commented Oct 26, 2018

I might rebase :

git fetch upstream
git merge upstream/master

and after that rerun isort to make sure everything is as you wanted. Rebase shouldn't change but it won't hurt.

@alexander-ponomaroff
Copy link
Contributor Author

@jreback Hello Jeff, I cannot seem to identify the cause of CI failing, it recently started failing after I resolved the second conflict with the master branch.

@alexander-ponomaroff
Copy link
Contributor Author

I notice that this was changed a few days ago, and it's now failing here:
https://github.com/pandas-dev/pandas/blame/5d84bc08ea7c45b0d2b3aa021a425b11531336f1/pandas/tests/frame/test_combine_concat.py#L776

@TomAugspurger you worked on this, do you have any advice for me? Or know why this failure was triggered in my pr?

@alexander-ponomaroff
Copy link
Contributor Author

@alimcmaster1 I reran everything from scratch and the previously triggered error doesn't trigger anymore. However there is an error now KeyError: <class 'pandas._libs.tslibs.timestamps.Timestamp'>, not sure what this has to do with anything I did. Do you have any suggestions?

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Oct 29, 2018 via email

@alexander-ponomaroff
Copy link
Contributor Author

@TomAugspurger I get this error: pandas/_libs/window.cpp:612:10: fatal error: 'ios' file not found

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Oct 29, 2018 via email

@alexander-ponomaroff
Copy link
Contributor Author

@TomAugspurger High Sierra 10.13.6

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Oct 29, 2018 via email

@alexander-ponomaroff
Copy link
Contributor Author

@TomAugspurger Got it, I updated the command line tools and it worked. I rebuilt the C extensions. Where do I go from here?

@alexander-ponomaroff
Copy link
Contributor Author

@TomAugspurger Btw, the error KeyError: <class 'pandas._libs.tslibs.timestamps.Timestamp'> is in one of the tests from Azure Pipelines, in case you thought that it was local. I just noticed that you're replying from an email. That's the only check I fail from the CI checks.

Utility functions related to concat
"""
Utility functions related to concat
"""
Copy link
Member

Choose a reason for hiding this comment

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

Don't think this indenting is required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix, accidental.

@alimcmaster1
Copy link
Member

alimcmaster1 commented Oct 30, 2018

"Btw, the error KeyError: <class 'pandas._libs.tslibs.timestamps.Timestamp'> is in one of the tests from Azure Pipelines"

I don't think the pipeline is failing because of this. Here is an example of a pipeline with the same test errors but the pipeline succeeds.

Your pipeline seems to be failing "WindowsPy27 py36_np121" builds with the error:

2018-10-29T15:30:51.4397165Z Could not find conda environment: pandas
2018-10-29T15:30:51.4398019Z You can list all discoverable environments with conda info --envs.
2018-10-29T15:30:56.1307704Z ModuleNotFoundError: No module named 'numpy'

Maybe @TomAugspurger could restart that for you? As i'm really not sure what the issue is there.

^ Ignore that @alexander-ponomaroff has just pushed a change- lets see if the above repeats.

@alexander-ponomaroff
Copy link
Contributor Author

alexander-ponomaroff commented Oct 30, 2018

@alimcmaster1 Thank you very much. Hopefully nothing will fail this time.

Looks like isort on the dtype directory keeps triggering weird behaviours :).

@alexander-ponomaroff
Copy link
Contributor Author

@alimcmaster1 Wow, finally! Everything passed. Thanks for you help.

@alexander-ponomaroff
Copy link
Contributor Author

@jreback Everything passed now, could you please merge if everything is good?

@@ -1,28 +1,20 @@
"""
missing types & inference
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

why did this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Accidental, will fix. When I had errors, I copy pasted imports from master and reran isort to attempt to fix the errors and the spacing on some of the comments messed up.

is_list_like,
is_hashable,
is_named_tuple)
# categorical; interval; datetimelike; string-like; sparse; numeric types; like
Copy link
Contributor

Choose a reason for hiding this comment

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

i am not sure of the value of this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This comment was generated by isort, will delete.

@alexander-ponomaroff
Copy link
Contributor Author

@jreback The requested changes have been changed, all checks pass.

@jreback jreback merged commit de39bfc into pandas-dev:master Oct 31, 2018
@jreback
Copy link
Contributor

jreback commented Oct 31, 2018

thanks @alexander-ponomaroff

tm9k1 pushed a commit to tm9k1/pandas that referenced this pull request Nov 19, 2018
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants