Skip to content

Commit 0b1320d

Browse files
Merge pull request #8988 from jorisvandenbossche/sql-8315
FIX: use decorator to append read_frame/frame_query docstring (GH8315)
2 parents d00e9c1 + 2565e1e commit 0b1320d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pandas/io/sql.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from pandas.core.common import isnull
2020
from pandas.core.base import PandasObject
2121
from pandas.tseries.tools import to_datetime
22+
from pandas.util.decorators import Appender
2223

2324
from contextlib import contextmanager
2425

@@ -1533,13 +1534,15 @@ def get_schema(frame, name, flavor='sqlite', keys=None, con=None):
15331534

15341535
# legacy names, with depreciation warnings and copied docs
15351536

1537+
@Appender(read_sql.__doc__, join='\n')
15361538
def read_frame(*args, **kwargs):
15371539
"""DEPRECATED - use read_sql
15381540
"""
15391541
warnings.warn("read_frame is deprecated, use read_sql", FutureWarning)
15401542
return read_sql(*args, **kwargs)
15411543

15421544

1545+
@Appender(read_sql.__doc__, join='\n')
15431546
def frame_query(*args, **kwargs):
15441547
"""DEPRECATED - use read_sql
15451548
"""
@@ -1587,8 +1590,3 @@ def write_frame(frame, name, con, flavor='sqlite', if_exists='fail', **kwargs):
15871590
index = kwargs.pop('index', False)
15881591
return to_sql(frame, name, con, flavor=flavor, if_exists=if_exists,
15891592
index=index, **kwargs)
1590-
1591-
1592-
# Append wrapped function docstrings
1593-
read_frame.__doc__ += read_sql.__doc__
1594-
frame_query.__doc__ += read_sql.__doc__

0 commit comments

Comments
 (0)