-
Notifications
You must be signed in to change notification settings - Fork 651
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
TEST-#6996: Update tests in test_io.py
#6997
Conversation
@pytest.mark.parametrize("sep", [None, "_", ",", ".", "\n"]) | ||
@pytest.mark.parametrize("delimiter", ["_", ",", ".", "\n"]) |
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.
These parameters mean the same thing. When using them at the same time, an exception occurs - I put it in a separate test.
@@ -303,7 +311,7 @@ def comparator(df1, df2): | |||
@pytest.mark.parametrize("header", ["infer", None, 0]) | |||
@pytest.mark.parametrize("index_col", [None, "col1"]) | |||
@pytest.mark.parametrize( | |||
"names", [lib.no_default, ["col1"], ["c1", "c2", "c3", "c4", "c5", "c6", "c7"]] |
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.
The last column is missing, this is a test to reproduce the same error as in pandas. It is redundant to test this situation with all combinations of parameters in this test.
# Internal parameters tests | ||
@pytest.mark.parametrize("use_str_data", [True, False]) | ||
@pytest.mark.parametrize("engine", [None, "python", "c"]) |
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.
Many parameters are not implemented for the python engine (and exceptions are thrown), moved to separate tests above.
@@ -2756,20 +2767,19 @@ def test_fwf_file_usecols(self, make_fwf_file, usecols): | |||
"dtype_backend", [lib.no_default, "numpy_nullable", "pyarrow"] | |||
) | |||
def test_read_fwf_dtype_backend(self, make_fwf_file, dtype_backend): | |||
with ensure_clean(".fwf") as unique_filename: | |||
make_fwf_file(filename=unique_filename) |
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.
make_fwf_file
fixture doesn't actually take a filename as a parameter.
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
modin/pandas/test/test_io.py
Outdated
def test_read_csv_delimiters( | ||
self, make_csv_file, sep, delimiter, decimal, thousands | ||
): | ||
def test_read_csv_delimiters(self, make_csv_file, sep, decimal, thousands): |
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.
def test_read_csv_delimiters(self, make_csv_file, sep, decimal, thousands): | |
def test_read_csv_seps(self, make_csv_file, sep, decimal, thousands): |
Should we rename this test for consistency with the parameter? or just rename the parameter name sep
to delimeter
.
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.
renamed
@@ -794,75 +802,64 @@ def test_read_csv_error_handling(self, on_bad_lines): | |||
on_bad_lines=on_bad_lines, | |||
) | |||
|
|||
@pytest.mark.parametrize("float_precision", [None, "high", "legacy", "round_trip"]) | |||
def test_python_engine_float_precision_except(self, float_precision): |
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.
Can you elaborate on why python engine only?
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.
We already tested python engine in test_read_csv_internal
, but I moved it to a separate test. Reason: #6997 (comment)
) | ||
|
||
@pytest.mark.parametrize("low_memory", [False, True]) | ||
def test_python_engine_low_memory_except(self, low_memory): |
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.
same
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.
We already tested python engine in test_read_csv_internal
, but I moved it to a separate test. Reason: #6997 (comment)
@@ -3095,6 +3097,12 @@ def test_read_xml(self): | |||
<degrees>360</degrees> | |||
<sides/> | |||
</row> | |||
<row> |
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.
Why is this added?
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.
The example is outdated, I took the updated one from https://pandas.pydata.org/docs/reference/api/pandas.read_xml.html#pandas-read-xml.
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
What do these changes do?
flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
git commit -s
test_io.py
#6996docs/development/architecture.rst
is up-to-date