-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REGR: Check for float in isnaobj_old #35510
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 2 commits
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
from pandas.errors import DtypeWarning, EmptyDataError, ParserError | ||
import pandas.util._test_decorators as td | ||
|
||
from pandas import DataFrame, Index, MultiIndex, Series, compat, concat | ||
from pandas import DataFrame, Index, MultiIndex, Series, compat, concat, option_context | ||
import pandas._testing as tm | ||
|
||
from pandas.io.parsers import CParserWrapper, TextFileReader, TextParser | ||
|
@@ -2179,3 +2179,13 @@ def test_read_csv_names_not_accepting_sets(all_parsers): | |
parser = all_parsers | ||
with pytest.raises(ValueError, match="Names should be an ordered collection."): | ||
parser.read_csv(StringIO(data), names=set("QAZ")) | ||
|
||
|
||
def test_read_csv_with_use_inf_as_na(all_parsers): | ||
# https://github.com/pandas-dev/pandas/issues/35493 | ||
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. see if u can locate this test near others that set options (not kwargs) 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. The others that use options seem to be in more targeted testing files (test_to_html.py, test_printing.py); this is the only one 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. kk |
||
parser = all_parsers | ||
data = "1.0\nNaN\n3.0" | ||
with option_context("use_inf_as_na", True): | ||
result = parser.read_csv(StringIO(data), header=None) | ||
expected = DataFrame([1.0, np.nan, 3.0]) | ||
tm.assert_frame_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.
write out the path to the option