-
-
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
DOC: fix EX03 Errors for pandas.DataFrame.to_sql #56866
DOC: fix EX03 Errors for pandas.DataFrame.to_sql #56866
Conversation
@@ -3042,7 +3042,7 @@ def to_sql( | |||
For MySQL, a callable to update columns ``b`` and ``c`` if there's a conflict | |||
on a primary key. | |||
|
|||
>>> from sqlalchemy.dialects.mysql import insert | |||
>>> from sqlalchemy.dialects.mysql import insert # doctest: +SKIP |
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.
Nice changes, just one comment. The error seems to suggest that insert
is already imported before but never used. Can you have a look, and remove the previous import if that's really the case.
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.
It's actually used in L3036:
... stmt = insert(table.table).values(data).on_conflict_do_nothing(index_elements=["a"])
I am not quite sure why it shows this error, but I think we could just # doctest: +SKIP
this line
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.
Ok, fair enough. Not sure if another option would be to remove this line. But having the skip is fine if there is no other obvious solution.
I'll resolve the conflict and let someone else review, so we have a second opinion, but this looks good to me.
@erichxchen, thank you for working on this. I think, there are some errors left that need to be fixed:
For example, the line Line 3041 in 02011f2
is too long. Could you please rewrite it as multi-line statement? It will fix one of the errors. |
Closed by #57025 |
Fix these EX03 Errors for
pandas.DataFrame.to_sql
: