Skip to content

Commit ae1ab89

Browse files
igblackaddergfyoung
authored andcommitted
DOC: Fix docstring for read_sql_table (pandas-dev#25465)
1 parent 169a56a commit ae1ab89

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

pandas/io/sql.py

+19-10
Original file line numberDiff line numberDiff line change
@@ -182,26 +182,29 @@ def execute(sql, con, cur=None, params=None):
182182
def read_sql_table(table_name, con, schema=None, index_col=None,
183183
coerce_float=True, parse_dates=None, columns=None,
184184
chunksize=None):
185-
"""Read SQL database table into a DataFrame.
185+
"""
186+
Read SQL database table into a DataFrame.
186187
187188
Given a table name and a SQLAlchemy connectable, returns a DataFrame.
188189
This function does not support DBAPI connections.
189190
190191
Parameters
191192
----------
192-
table_name : string
193+
table_name : str
193194
Name of SQL table in database.
194-
con : SQLAlchemy connectable (or database string URI)
195+
con : SQLAlchemy connectable or str
196+
A database URI could be provided as as str.
195197
SQLite DBAPI connection mode not supported.
196-
schema : string, default None
198+
schema : str, default None
197199
Name of SQL schema in database to query (if database flavor
198200
supports this). Uses default schema if None (default).
199-
index_col : string or list of strings, optional, default: None
201+
index_col : str or list of str, optional, default: None
200202
Column(s) to set as index(MultiIndex).
201-
coerce_float : boolean, default True
203+
coerce_float : bool, default True
202204
Attempts to convert values of non-string, non-numeric objects (like
203205
decimal.Decimal) to floating point. Can result in loss of Precision.
204-
parse_dates : list or dict, default: None
206+
parse_dates : list or dict, default None
207+
The behavior is as follows:
205208
- List of column names to parse as dates.
206209
- Dict of ``{column_name: format string}`` where format string is
207210
strftime compatible in case of parsing string times or is one of
@@ -210,24 +213,30 @@ def read_sql_table(table_name, con, schema=None, index_col=None,
210213
to the keyword arguments of :func:`pandas.to_datetime`
211214
Especially useful with databases without native Datetime support,
212215
such as SQLite.
213-
columns : list, default: None
214-
List of column names to select from SQL table
216+
columns : list, default None
217+
List of column names to select from SQL table.
215218
chunksize : int, default None
216219
If specified, returns an iterator where `chunksize` is the number of
217220
rows to include in each chunk.
218221
219222
Returns
220223
-------
221224
DataFrame
225+
A SQL table is returned as two-dimensional data structure with labeled
226+
axes.
222227
223228
See Also
224229
--------
225230
read_sql_query : Read SQL query into a DataFrame.
226-
read_sql
231+
read_sql : Read SQL query or database table into a DataFrame.
227232
228233
Notes
229234
-----
230235
Any datetime values with time zone information will be converted to UTC.
236+
237+
Examples
238+
--------
239+
>>> pd.read_sql_table('table_name', 'postgres:///db_name') # doctest:+SKIP
231240
"""
232241

233242
con = _engine_builder(con)

0 commit comments

Comments
 (0)