Skip to content
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 for pd.to_sql column error if data contains -np.inf #34493

Merged
merged 46 commits into from
Jul 1, 2020

Conversation

arw2019
Copy link
Member

@arw2019 arw2019 commented May 31, 2020

@arw2019
Copy link
Member Author

arw2019 commented Jun 7, 2020

Hey everyone - checking in in case there's anything I can do to keep this PR moving forward!

@mroeschke
Copy link
Member

Looks like there is a merge conflict and there are some CI failures in the Travis build

@arw2019
Copy link
Member Author

arw2019 commented Jun 20, 2020

@mroeschke Ok, I've looked into that now.

It seems that the new test is failing:

=========================== short test summary info ============================
FAILED pandas/tests/io/test_sql.py::TestMySQLAlchemy::test_to_sql_with_negative_npinf[load_iris_data0-input0]
FAILED pandas/tests/io/test_sql.py::TestMySQLAlchemy::test_to_sql_with_negative_npinf[load_iris_data0-input1]
FAILED pandas/tests/io/test_sql.py::TestMySQLAlchemy::test_to_sql_with_negative_npinf[load_iris_data0-input2]
FAILED pandas/tests/io/test_sql.py::TestMySQLAlchemyConn::test_to_sql_with_negative_npinf[load_iris_data0-input0]
FAILED pandas/tests/io/test_sql.py::TestMySQLAlchemyConn::test_to_sql_with_negative_npinf[load_iris_data0-input1]
FAILED pandas/tests/io/test_sql.py::TestMySQLAlchemyConn::test_to_sql_with_negative_npinf[load_iris_data0-input2]
= 6 failed, 72578 passed, 1156 skipped, 1016 xfailed, 115 warnings in 1193.92s (0:19:53) =
The command "ci/run_tests.sh" exited with 1.

But when I run pytest -q pandas/tests/io/test_sql.py everything passes. Do by any chance you have an idea of what might be going on?

Either way, what's the best way to proceed on this PR? Should I try to fix the problem in this PR (happy to carry on but I'll need some help on where to start debugging - not sure what to try right now) or mark the test as xfail?

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions IO SQL to_sql, read_sql, read_sql_query labels Jun 20, 2020
@mroeschke
Copy link
Member

Looks like this issue isn't fully solved for MySQL based on the test failures.

If you would like to solve this issue for MySQL, that'd be great. It might need to be handled in sql.py.

Otherwise, we would also xfail the test for MySQL and leave the original issue open.

@arw2019 arw2019 requested a review from mroeschke June 24, 2020 03:05
@arw2019
Copy link
Member Author

arw2019 commented Jun 24, 2020

Looks ready to go - happy to work on any improvements, though!

pandas/io/sql.py Outdated Show resolved Hide resolved
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment otherwise LGTM

@mroeschke mroeschke merged commit 5507452 into pandas-dev:master Jul 1, 2020
@mroeschke
Copy link
Member

Thanks @arw2019. Nice PR as always

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions IO SQL to_sql, read_sql, read_sql_query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pandas.to_sql raises unexpected column error if data contains -numpy.inf
3 participants