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

ENH: Add columns argument to read_feather() (#24025) #24034

Merged
merged 5 commits into from Dec 4, 2018
Merged

ENH: Add columns argument to read_feather() (#24025) #24034

merged 5 commits into from Dec 4, 2018

Conversation

nixphix
Copy link
Contributor

@nixphix nixphix commented Dec 1, 2018

I have added test case but when running

pytest pandas/tests/io/test_feather.py

test cases (including some of already existing test cases) fails with error

NotImplementedError: > 1 ndim Categorical are not supported at this time

let me know if this is expected or I'm missing something

@pep8speaks
Copy link

Hello @nixphix! Thanks for submitting the PR.

@codecov
Copy link

codecov bot commented Dec 1, 2018

Codecov Report

Merging #24034 into master will not change coverage.
The diff coverage is 66.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24034   +/-   ##
=======================================
  Coverage   42.46%   42.46%           
=======================================
  Files         161      161           
  Lines       51557    51557           
=======================================
  Hits        21892    21892           
  Misses      29665    29665
Flag Coverage Δ
#single 42.46% <66.66%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/feather_format.py 89.74% <66.66%> (ø) ⬆️

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 5b6b346...43afb8d. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 1, 2018

Codecov Report

Merging #24034 into master will increase coverage by 49.86%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #24034       +/-   ##
===========================================
+ Coverage   42.38%   92.25%   +49.86%     
===========================================
  Files         161      161               
  Lines       51701    51701               
===========================================
+ Hits        21914    47696    +25782     
+ Misses      29787     4005    -25782
Flag Coverage Δ
#multiple 90.65% <33.33%> (?)
#single 42.38% <66.66%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/feather_format.py 89.74% <66.66%> (ø) ⬆️
pandas/core/computation/pytables.py 92.37% <0%> (+0.3%) ⬆️
pandas/io/pytables.py 92.3% <0%> (+0.92%) ⬆️
pandas/util/_test_decorators.py 93.24% <0%> (+4.05%) ⬆️
pandas/compat/__init__.py 58.36% <0%> (+8.17%) ⬆️
pandas/core/config_init.py 99.24% <0%> (+9.84%) ⬆️
pandas/core/reshape/util.py 100% <0%> (+11.53%) ⬆️
pandas/compat/numpy/__init__.py 92.85% <0%> (+14.28%) ⬆️
pandas/core/computation/common.py 85.71% <0%> (+14.28%) ⬆️
pandas/core/api.py 100% <0%> (+14.81%) ⬆️
... and 120 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 08395af...8a997fc. Read the comment docs.

pandas/tests/io/test_feather.py Outdated Show resolved Hide resolved
@TomAugspurger TomAugspurger added the IO Data IO issues that don't fit into a more specific label label Dec 1, 2018
@TomAugspurger TomAugspurger added this to the 0.24.0 milestone Dec 1, 2018
@TomAugspurger
Copy link
Contributor

TomAugspurger commented Dec 1, 2018 via email

@nixphix
Copy link
Contributor Author

nixphix commented Dec 1, 2018

@TomAugspurger It's just that I'm not a fan of hard coded values, thought it might make the test case more dynamic and robust. I will change it to list for better readability.

@jreback jreback removed this from the 0.24.0 milestone Dec 2, 2018
Copy link
Member

@gfyoung gfyoung left a comment

Choose a reason for hiding this comment

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

@@ -74,6 +77,21 @@ def test_stringify_columns(self):
df = pd.DataFrame(np.arange(12).reshape(4, 3)).copy()
self.check_error_on_write(df, ValueError)

@pytest.mark.parametrize("columns", [
Copy link
Contributor

Choose a reason for hiding this comment

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

I hate to harp on this, but what are we testing by parametrizing this test? IMO, we should only be concerned with testing that pandas passes through the columns argument, so these tests seem redundant. I'd only keep the ['col1', 'col2'] test.

Are we worried about pyarrow breaking something, so this is some kind of integration test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, let's not worry about how the integration works, removed None and ['col1', 'col2', 'col3', 'col4']

@jreback jreback added this to the 0.24.0 milestone Dec 4, 2018
@jreback
Copy link
Contributor

jreback commented Dec 4, 2018

lgtm. @TomAugspurger

@TomAugspurger TomAugspurger merged commit 72980fb into pandas-dev:master Dec 4, 2018
@TomAugspurger
Copy link
Contributor

Thanks @nixphix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add columns-parameter like in feather.read_dataframe
5 participants