-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
STY: Enable ruff ambiguous unicode character #54330
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
Changes from 6 commits
9f4fe10
8041543
ecdc7c1
fb0c8bc
a5aa933
fe96467
c24889e
3538da0
e484ee0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ def test_to_csv_path_is_none(self): | |
# GH 21241, 21118 | ||
(Series(["abc", "def", "ghi"], name="X"), "ascii"), | ||
(Series(["123", "你好", "世界"], name="中文"), "gb2312"), | ||
(Series(["123", "Γειά σου", "Κόσμε"], name="Ελληνικά"), "cp737"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah good call. Fixed |
||
(Series(["123", "Γειά oou", "Κόσμε"], name="Ελληνικά"), "cp737"), | ||
], | ||
) | ||
def test_to_csv_compression(self, s, encoding, compression): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -226,8 +226,8 @@ def test_isnumeric_unicode(method, expected, any_string_dtype): | |
# 0x00bc: ¼ VULGAR FRACTION ONE QUARTER | ||
# 0x2605: ★ not number | ||
# 0x1378: ፸ ETHIOPIC NUMBER SEVENTY | ||
# 0xFF13: 3 Em 3 | ||
ser = Series(["A", "3", "¼", "★", "፸", "3", "four"], dtype=any_string_dtype) | ||
# 0xFF13: 3 Em 3 # noqa: RUF003 | ||
ser = Series(["A", "3", "¼", "★", "፸", "3", "four"], dtype=any_string_dtype) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like the comment above is indicating this one shouldn't be changed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark for the rest of the changes in this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. Added noqas here |
||
expected_dtype = "bool" if any_string_dtype == "object" else "boolean" | ||
expected = Series(expected, dtype=expected_dtype) | ||
result = getattr(ser.str, method)() | ||
|
@@ -246,7 +246,7 @@ def test_isnumeric_unicode(method, expected, any_string_dtype): | |
], | ||
) | ||
def test_isnumeric_unicode_missing(method, expected, any_string_dtype): | ||
values = ["A", np.nan, "¼", "★", np.nan, "3", "four"] | ||
values = ["A", np.nan, "¼", "★", np.nan, "3", "four"] | ||
ser = Series(values, dtype=any_string_dtype) | ||
expected_dtype = "object" if any_string_dtype == "object" else "boolean" | ||
expected = Series(expected, dtype=expected_dtype) | ||
|
@@ -564,12 +564,12 @@ def test_decode_errors_kwarg(): | |
"form, expected", | ||
[ | ||
("NFKC", ["ABC", "ABC", "123", np.nan, "アイエ"]), | ||
("NFC", ["ABC", "ABC", "123", np.nan, "アイエ"]), | ||
("NFC", ["ABC", "ABC", "123", np.nan, "アイエ"]), | ||
], | ||
) | ||
def test_normalize(form, expected, any_string_dtype): | ||
ser = Series( | ||
["ABC", "ABC", "123", np.nan, "アイエ"], | ||
["ABC", "ABC", "123", np.nan, "アイエ"], | ||
index=["a", "b", "c", "d", "e"], | ||
dtype=any_string_dtype, | ||
) | ||
|
@@ -580,7 +580,7 @@ def test_normalize(form, expected, any_string_dtype): | |
|
||
def test_normalize_bad_arg_raises(any_string_dtype): | ||
ser = Series( | ||
["ABC", "ABC", "123", np.nan, "アイエ"], | ||
["ABC", "ABC", "123", np.nan, "アイエ"], | ||
index=["a", "b", "c", "d", "e"], | ||
dtype=any_string_dtype, | ||
) | ||
|
@@ -589,7 +589,7 @@ def test_normalize_bad_arg_raises(any_string_dtype): | |
|
||
|
||
def test_normalize_index(): | ||
idx = Index(["ABC", "123", "アイエ"]) | ||
idx = Index(["ABC", "123", "アイエ"]) | ||
expected = Index(["ABC", "123", "アイエ"]) | ||
result = idx.str.normalize("NFKC") | ||
tm.assert_index_equal(result, expected) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noqa here instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Fixed