Skip to content

CLN: Remove unicode u string prefix #25864

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 2 commits into from
Mar 25, 2019

Conversation

jschendel
Copy link
Member

More Python 2 removal. Could use a second pair of eyes to make sure the regex I used to make these fixes wasn't overzealous anywhere.

@jschendel jschendel added this to the 0.25.0 milestone Mar 24, 2019
@jschendel
Copy link
Member Author

jschendel commented Mar 24, 2019

I think as-is this will fail CI only because the following xfailed test is now passing, and we're being strict with XPASS here:

@pytest.mark.xfail
def test_to_csv_string_array_utf8(self):
# GH 10813
str_array = [{'names': ['foo', 'bar']}, {'names': ['baz', 'qux']}]
df = pd.DataFrame(str_array)
expected_utf8 = '''\
,names
0,"[u'foo', u'bar']"
1,"[u'baz', u'qux']"
'''
with tm.ensure_clean('unicode_test.csv') as path:
df.to_csv(path, encoding='utf-8')
with open(path, 'r') as f:
assert f.read() == expected_utf8

The only change I made a was removing the u prefix on lines 362-3, so it looks like this was only failing on Python 3 due to the expected string containing the prefixes? I was able to manually confirm that this appears to be working on Python 3 and failing on Python 2 in the 0.24.2 release, meaning the issue was Python 2 specific and we can remove the xfail?

cc @jreback : Does the above make sense to you, or am I misinterpreting the issue? If so, does it make sense to also close the associated issue #10813?

@codecov
Copy link

codecov bot commented Mar 24, 2019

Codecov Report

Merging #25864 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #25864   +/-   ##
=======================================
  Coverage   91.47%   91.47%           
=======================================
  Files         173      173           
  Lines       52868    52868           
=======================================
  Hits        48362    48362           
  Misses       4506     4506
Flag Coverage Δ
#multiple 90.04% <0%> (ø) ⬆️
#single 41.82% <0%> (ø) ⬆️

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 dca809b...d655d4f. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 24, 2019

Codecov Report

Merging #25864 into master will increase coverage by <.01%.
The diff coverage is 91.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25864      +/-   ##
==========================================
+ Coverage   91.47%   91.47%   +<.01%     
==========================================
  Files         173      173              
  Lines       52868    52872       +4     
==========================================
+ Hits        48362    48366       +4     
  Misses       4506     4506
Flag Coverage Δ
#multiple 90.04% <87.43%> (ø) ⬆️
#single 41.82% <37.69%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/arrays/categorical.py 95.96% <ø> (ø) ⬆️
pandas/core/indexing.py 90.87% <ø> (ø) ⬆️
pandas/core/arrays/base.py 98.27% <ø> (ø) ⬆️
pandas/core/indexes/multi.py 95.62% <ø> (ø) ⬆️
pandas/core/dtypes/dtypes.py 96.1% <ø> (ø) ⬆️
pandas/errors/__init__.py 100% <ø> (ø) ⬆️
pandas/core/reshape/pivot.py 96.55% <100%> (ø) ⬆️
pandas/io/formats/format.py 97.99% <100%> (ø) ⬆️
pandas/core/arrays/period.py 98.53% <100%> (ø) ⬆️
pandas/core/indexes/period.py 92.06% <100%> (ø) ⬆️
... and 8 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 dca809b...0fdc0cb. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Mar 24, 2019

that issue looks pretty confusing so not sure
you can make strict=False to get this PR passing

@jschendel
Copy link
Member Author

okay, marked it as @pytest.mark.xfail(strict=False)

@jreback
Copy link
Contributor

jreback commented Mar 25, 2019

thanks @jschendel

@jreback jreback merged commit d8642e9 into pandas-dev:master Mar 25, 2019
@jschendel jschendel deleted the remove-str-u-prefix branch March 28, 2019 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Unicode Unicode strings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants