-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
CLN: Removed the flavor parameter in DataFrame.to_sql #13611
CLN: Removed the flavor parameter in DataFrame.to_sql #13611
Conversation
6397fc0
to
8aff8be
Compare
@gfyoung We cannot just remove the flavor keyword. It was only deprecated for 'mysql', not for 'sqlite' (wihch is a pitty ..) |
@jorisvandenbossche : But the argument accepts only one value now ( |
No, we are certainly not planning that. And in retrospect, it's a pitty that we didn't deprecate the full flavor keyword. But we have to deal with it now. I think we should give a nice error/warning message in case of |
@jorisvandenbossche : How does adding a |
8aff8be
to
d552781
Compare
@gfyoung That sounds good! |
d552781
to
1eabcc7
Compare
@jorisvandenbossche : added |
Current coverage is 84.37%
|
def to_sql(self, name, con, flavor='sqlite', schema=None, if_exists='fail', | ||
index=True, index_label=None, chunksize=None, dtype=None): | ||
def to_sql(self, name, con, schema=None, if_exists='fail', index=True, | ||
index_label=None, chunksize=None, dtype=None, *args, **kwargs): |
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.
I don't think the *args
are needed here. If people were using positional kwargs, the current deprecation will not work anyways (as schema
will catch the flavor)
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.
Alternative is to keep flavor
in the signature, but change it to None, so we can detect when people set it to 'sqlite'
themselves. That solves the positional kwarg problem, but of course pollutes the signature a bit.
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.
Argh...good point. I think I'll just remove the '*args' parameter and not pollute the signature.
1eabcc7
to
a571728
Compare
@jreback , @jorisvandenbossche : Updated the signatures, and Travis is still giving the green light. Ready to merge if there are no other concerns. |
@gfyoung yeah, I saw your ping, but I also have other work :-) I worry a bit about the usage of |
Yeah...that is a fair point. Original purpose was to just remove the 'mysql' option, so let me scale this PR back down to that. |
@gfyoung Yes, but I think it would still be good to deprecated the flavor arg, so we can remove it later on. So if you want to do that, I don't it is a large change from what you have now, it's just adding it back in the signature and replacing the kwarg validator with only the deprecation part of it |
b28152c
to
4dd32bb
Compare
@jorisvandenbossche : Updated the signature and put the |
4dd32bb
to
74e8975
Compare
@jreback, @jorisvandenbossche : rebased and Travis is still happy - ready to merge if there are no other concerns. |
@@ -492,6 +492,7 @@ Deprecations | |||
- ``Categorical.reshape`` has been deprecated and will be removed in a subsequent release (:issue:`12882`) | |||
- ``Series.reshape`` has been deprecated and will be removed in a subsequent release (:issue:`12882`) | |||
|
|||
- ``DataFrame.to_sql()`` has deprecated the ``flavor`` parameter (:issue:`13611`) |
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 emphasize that is is a superfluous keyword (so no reason to use it), since sqlite is the only supported connection when not using sqlalchemy?
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.
Done.
@gfyoung Looks good! (using flavor=None is perfect for detecting if user has specified it themselves) Few minor comments. |
74e8975
to
50885cc
Compare
@jorisvandenbossche : made the requested doc changes (no need to run tests, hence the |
50885cc
to
267ac79
Compare
573646a
to
4562ec4
Compare
4562ec4
to
02d05a2
Compare
@jorisvandenbossche : any updates on this? |
Yes, merging! Thanks a lot |
Deprecated in
0.14.0
, so way, way overdue.