Skip to content

Add _expand_user to _stringify_path as we need to allow tilde - ~, to expand to full path #23769

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

Merged
merged 10 commits into from
Jan 5, 2019

Conversation

srinivasreddy
Copy link
Contributor

@srinivasreddy srinivasreddy commented Nov 18, 2018

@pep8speaks
Copy link

pep8speaks commented Nov 18, 2018

Hello @srinivasreddy! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on January 05, 2019 at 18:39 Hours UTC

@jreback
Copy link
Contributor

jreback commented Nov 18, 2018

we have some tests in io/test_common.py ; do these need to be expanded?

@srinivasreddy
Copy link
Contributor Author

Nope. I do not see the need. build pass should make it good to go.

@jreback
Copy link
Contributor

jreback commented Nov 18, 2018

ok, can you add a whatsnew note

@jreback jreback added the IO Data IO issues that don't fit into a more specific label label Nov 18, 2018
@codecov
Copy link

codecov bot commented Nov 19, 2018

Codecov Report

Merging #23769 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23769      +/-   ##
==========================================
+ Coverage   92.37%   92.37%   +<.01%     
==========================================
  Files         166      166              
  Lines       52379    52379              
==========================================
+ Hits        48386    48387       +1     
+ Misses       3993     3992       -1
Flag Coverage Δ
#multiple 90.8% <100%> (ø) ⬆️
#single 43.01% <100%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/io/common.py 72.86% <100%> (ø) ⬆️
pandas/util/testing.py 88.09% <0%> (+0.09%) ⬆️

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 4b4bf72...0a660e0. Read the comment docs.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

I actually would prefer adding a test case here which could be parametrized like say test_read_non_existant within the same module.

pytest.importorskip(module)

path = os.path.join('~', 'does_not_exist.' + fn_ext)
with pytest.raises(error_class):
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this test actually does anything within the context of this change. Is there a way to make a stronger assertion about this actually working?

Another option may be to patch a call to _expand_user and assert it gets called via these functions

@jreback
Copy link
Contributor

jreback commented Dec 9, 2018

can you merge master and address comments

@jreback
Copy link
Contributor

jreback commented Dec 23, 2018

can you merge master

@jreback
Copy link
Contributor

jreback commented Jan 5, 2019

@pandas-dev/pandas-core if someone can merge master and update the test

@WillAyd
Copy link
Member

WillAyd commented Jan 5, 2019

Sure I'll take a look

pytest.importorskip(module)

path = os.path.join('~', 'does_not_exist.' + fn_ext)
monkeypatch.setattr(icom, '_expand_user',
Copy link
Member

Choose a reason for hiding this comment

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

Could alternately use mock.assert_called for this test but didn't see that library used anywhere else and I know we've been removing it from other instances, so this is an alternate way of using monkey patch to get to the same place

@WillAyd
Copy link
Member

WillAyd commented Jan 5, 2019

@jreback all green let me know your thoughts

@jreback jreback added this to the 0.24.0 milestone Jan 5, 2019
@jreback jreback merged commit f074abe into pandas-dev:master Jan 5, 2019
@jreback
Copy link
Contributor

jreback commented Jan 5, 2019

thanks @srinivasreddy & @WillAyd

@srinivasreddy srinivasreddy deleted the 23473 branch January 6, 2019 17:15
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
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.

Use expanduser when writing dataframes to files?
4 participants