Skip to content

Commit 45b5409

Browse files
committed
CLN: Remove unnecessary io function returns
These functions return a function either with empty return statement or doesn’t return. It causes docstring validation error with type RT01 (See pandas-dev#26234).
1 parent 3de7139 commit 45b5409

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

pandas/core/frame.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,13 +1394,12 @@ def to_gbq(self, destination_table, project_id=None, chunksize=None,
13941394
read_gbq : Read a DataFrame from Google BigQuery.
13951395
"""
13961396
from pandas.io import gbq
1397-
return gbq.to_gbq(
1398-
self, destination_table, project_id=project_id,
1399-
chunksize=chunksize, reauth=reauth, if_exists=if_exists,
1400-
auth_local_webserver=auth_local_webserver,
1401-
table_schema=table_schema, location=location,
1402-
progress_bar=progress_bar, credentials=credentials,
1403-
verbose=verbose, private_key=private_key)
1397+
gbq.to_gbq(self, destination_table, project_id=project_id,
1398+
chunksize=chunksize, reauth=reauth, if_exists=if_exists,
1399+
auth_local_webserver=auth_local_webserver,
1400+
table_schema=table_schema, location=location,
1401+
progress_bar=progress_bar, credentials=credentials,
1402+
verbose=verbose, private_key=private_key)
14041403

14051404
@classmethod
14061405
def from_records(cls, data, index=None, exclude=None, columns=None,

pandas/core/generic.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,7 +2403,7 @@ def to_hdf(self, path_or_buf, key, **kwargs):
24032403
>>> os.remove('data.h5')
24042404
"""
24052405
from pandas.io import pytables
2406-
return pytables.to_hdf(path_or_buf, key, self, **kwargs)
2406+
pytables.to_hdf(path_or_buf, key, self, **kwargs)
24072407

24082408
def to_msgpack(self, path_or_buf=None, encoding='utf-8', **kwargs):
24092409
"""
@@ -2615,8 +2615,7 @@ def to_pickle(self, path, compression='infer',
26152615
>>> os.remove("./dummy.pkl")
26162616
"""
26172617
from pandas.io.pickle import to_pickle
2618-
return to_pickle(self, path, compression=compression,
2619-
protocol=protocol)
2618+
to_pickle(self, path, compression=compression, protocol=protocol)
26202619

26212620
def to_clipboard(self, excel=True, sep=None, **kwargs):
26222621
r"""

0 commit comments

Comments
 (0)