Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
to_sql also accepts Series
  • Loading branch information
Guilherme Beltramini committed Mar 5, 2018
commit 0215116e5dfa8b83c01d0fe7944575c32965933c
2 changes: 1 addition & 1 deletion pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def to_sql(frame, name, con, schema=None, if_exists='fail', index=True,

Parameters
----------
frame : DataFrame
frame : DataFrame, Series
Copy link
Contributor

Choose a reason for hiding this comment

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

@jorisvandenbossche is this right? should we deprecate / rename this parameter?

Copy link
Member

Choose a reason for hiding this comment

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

yes, this seems right, as a few lines below it does:

    if isinstance(frame, Series):
        frame = frame.to_frame()

but since this is mostly an internal method (most people will directly use DataFrame/Series.to_sql), I don't think we should bother with deprecating or renaming it

name : string
Name of SQL table.
con : SQLAlchemy connectable(engine/connection) or database string URI
Expand Down