-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Fix precise_xstrtod segfault on long exponent #38789
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 4 commits
f42b65a
bb77ab2
3a0ac2e
7b0cc62
1011a1b
39dd79c
58bbed5
0f5f103
013a31f
0a48ed8
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 |
---|---|---|
|
@@ -1351,6 +1351,30 @@ def test_numeric_range_too_wide(all_parsers, exp_data): | |
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
@pytest.mark.parametrize("neg_exp", [-617, -100000, -99999999999999999]) | ||
def test_very_negative_exponent(all_parsers, neg_exp): | ||
# GH#38753 | ||
parser = all_parsers | ||
data = f"data\n10E{neg_exp}" | ||
for precision in parser.float_precision_choices: | ||
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. you can parameterize on these too 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. Issue I ran into is that the parsers don't have consistent potential 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. Some kind of fixture-within-a-fixture functionality would be nice, though not sure if that's feasible... 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. Added a new fixture, |
||
result = parser.read_csv(StringIO(data), float_precision=precision) | ||
expected = DataFrame({"data": [0.0]}) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
@pytest.mark.parametrize("exp", [999999999999999999, -999999999999999999]) | ||
def test_too_many_exponent_digits(all_parsers, exp): | ||
# GH#38753 | ||
parser = all_parsers | ||
data = f"data\n10E{exp}" | ||
for precision in parser.float_precision_choices: | ||
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 |
||
if precision == "round_trip": | ||
continue | ||
result = parser.read_csv(StringIO(data), float_precision=precision) | ||
expected = DataFrame({"data": [f"10E{exp}"]}) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
|
||
@pytest.mark.parametrize("iterator", [True, False]) | ||
def test_empty_with_nrows_chunksize(all_parsers, iterator): | ||
# see gh-9535 | ||
|
Uh oh!
There was an error while loading. Please reload this page.