Skip to content

DOC: code example isn't formatted in pandas.DataFrame.to_sql #36922

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

Closed
hkennyv opened this issue Oct 6, 2020 · 0 comments · Fixed by #36923
Closed

DOC: code example isn't formatted in pandas.DataFrame.to_sql #36922

hkennyv opened this issue Oct 6, 2020 · 0 comments · Fixed by #36923
Labels
Milestone

Comments

@hkennyv
Copy link
Contributor

hkennyv commented Oct 6, 2020

Location of the documentation

The code example in pandas.DataFrame.to_sql isn't formatted properly.

(it's the example that inserts User 4 and User 5 into the db)

Note: You can check the latest versions of the docs on master here.

Documentation problem

image

oh no, the code isn't formatted correctly!

Suggested fix for documentation

The reason is there's no blank line before the code snippet, see:

pandas/pandas/core/generic.py

Lines 2692 to 2695 in b58ee57

An `sqlalchemy.engine.Connection` can also be passed to to `con`:
>>> with engine.begin() as connection:
... df1 = pd.DataFrame({'name' : ['User 4', 'User 5']})
... df1.to_sql('users', con=connection, if_exists='append')

Add a blank line above the code snippet :), i have a PR in progress

@hkennyv hkennyv added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 6, 2020
@dsaxton dsaxton removed the Needs Triage Issue that has not been reviewed by a pandas team member label Oct 6, 2020
@jreback jreback added this to the 1.2 milestone Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants