-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
BUG/TST: Fix io.sql.write_frame replace bug and complete test coverage of if_exists functionality #4304
BUG/TST: Fix io.sql.write_frame replace bug and complete test coverage of if_exists functionality #4304
Conversation
related to #4163 |
The if_exists argument in io.sql.write_frame needed data validation because the logic of the function implicitly used 'append' if the argument value was any string that was not either 'fail' or 'replace'. I added a new unit test to support the requirement.
This should resolve issues pandas-dev#2971 and pandas-dev#4110
This refactor results in the function logic being clearer, since if_exists is only relevant when exists is True, the program flow is better served to have if_exists control flow only when exists is True
…1d8d4 sqlite3 convenience function executescript not available in other database flavors.
Rebased and added test coverage for mysql flavor |
@hayd you have this included in SQL ? |
@jreback thanks, I'd missed this. Will squish and add in to legacy and sqlalchemy. |
@hayd just keeping it on the radar |
squished and rebased this branch, will see if it passes/what needs fixing. Agree this was bad, apologies on dropping the ball here. Should make sure this is also fixed in the new stuff. |
@jorisvandenbossche @hayd should this be incorporated / closed |
This fixes #2971 and #4110. This also provides test coverage for the different values for the if_exists argument for io.sql.write_frame.