Skip to content

Commit dc91d9f

Browse files
dkane01dkane01
authored andcommitted
ENH: set __module__ on remaining io.* (pandas-dev#62597)
Co-authored-by: dkane01 <[email protected]>
1 parent 76ffa96 commit dc91d9f

File tree

18 files changed

+87
-8
lines changed

18 files changed

+87
-8
lines changed

pandas/io/clipboards.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import warnings
88

99
from pandas._libs import lib
10+
from pandas.util._decorators import set_module
1011
from pandas.util._exceptions import find_stack_level
1112
from pandas.util._validators import check_dtype_backend
1213

@@ -21,6 +22,7 @@
2122
from pandas._typing import DtypeBackend
2223

2324

25+
@set_module("pandas")
2426
def read_clipboard(
2527
sep: str = r"\s+",
2628
dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default,

pandas/io/excel/_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from pandas.util._decorators import (
4040
Appender,
4141
doc,
42+
set_module,
4243
)
4344
from pandas.util._exceptions import find_stack_level
4445
from pandas.util._validators import check_dtype_backend
@@ -434,6 +435,7 @@ def read_excel(
434435
) -> dict[IntStrT, DataFrame]: ...
435436

436437

438+
@set_module("pandas")
437439
@doc(storage_options=_shared_docs["storage_options"])
438440
@Appender(_read_excel_doc)
439441
def read_excel(
@@ -951,6 +953,7 @@ def _parse_sheet(
951953
return output
952954

953955

956+
@set_module("pandas")
954957
@doc(storage_options=_shared_docs["storage_options"])
955958
class ExcelWriter(Generic[_WorkbookT]):
956959
"""
@@ -1471,6 +1474,7 @@ def inspect_excel_format(
14711474
return "zip"
14721475

14731476

1477+
@set_module("pandas")
14741478
@doc(storage_options=_shared_docs["storage_options"])
14751479
class ExcelFile:
14761480
"""

pandas/io/feather_format.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
from pandas._libs import lib
1414
from pandas.compat._optional import import_optional_dependency
1515
from pandas.errors import Pandas4Warning
16-
from pandas.util._decorators import doc
16+
from pandas.util._decorators import (
17+
doc,
18+
set_module,
19+
)
1720
from pandas.util._validators import check_dtype_backend
1821

1922
from pandas.core.api import DataFrame
@@ -68,6 +71,7 @@ def to_feather(
6871
feather.write_feather(df, handles.handle, **kwargs)
6972

7073

74+
@set_module("pandas")
7175
@doc(storage_options=_shared_docs["storage_options"])
7276
def read_feather(
7377
path: FilePath | ReadBuffer[bytes],

pandas/io/formats/format.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
Timestamp,
4343
)
4444
from pandas._libs.tslibs.nattype import NaTType
45+
from pandas.util._decorators import set_module
4546

4647
from pandas.core.dtypes.common import (
4748
is_complex_dtype,
@@ -1955,6 +1956,7 @@ def __call__(self, num: float) -> str:
19551956
return formatted
19561957

19571958

1959+
@set_module("pandas")
19581960
def set_eng_float_format(accuracy: int = 3, use_eng_prefix: bool = False) -> None:
19591961
"""
19601962
Format float representation in DataFrame with SI notation.

pandas/io/html.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
AbstractMethodError,
2525
EmptyDataError,
2626
)
27-
from pandas.util._decorators import doc
27+
from pandas.util._decorators import (
28+
doc,
29+
set_module,
30+
)
2831
from pandas.util._validators import check_dtype_backend
2932

3033
from pandas.core.dtypes.common import is_list_like
@@ -1024,6 +1027,7 @@ def _parse(
10241027
return ret
10251028

10261029

1030+
@set_module("pandas")
10271031
@doc(storage_options=_shared_docs["storage_options"])
10281032
def read_html(
10291033
io: FilePath | ReadBuffer[str],

pandas/io/iceberg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
)
44

55
from pandas.compat._optional import import_optional_dependency
6+
from pandas.util._decorators import set_module
67

78
from pandas import DataFrame
89

910

11+
@set_module("pandas")
1012
def read_iceberg(
1113
table_identifier: str,
1214
catalog_name: str | None = None,

pandas/io/json/_json.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
from pandas._libs.tslibs import iNaT
3030
from pandas.compat._optional import import_optional_dependency
3131
from pandas.errors import AbstractMethodError
32-
from pandas.util._decorators import doc
32+
from pandas.util._decorators import (
33+
doc,
34+
set_module,
35+
)
3336
from pandas.util._validators import check_dtype_backend
3437

3538
from pandas.core.dtypes.common import (
@@ -496,6 +499,7 @@ def read_json(
496499
) -> DataFrame: ...
497500

498501

502+
@set_module("pandas")
499503
@doc(
500504
storage_options=_shared_docs["storage_options"],
501505
decompression_options=_shared_docs["decompression_options"] % "path_or_buf",

pandas/io/json/_normalize.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import numpy as np
1818

1919
from pandas._libs.writers import convert_json_to_lines
20+
from pandas.util._decorators import set_module
2021

2122
import pandas as pd
2223
from pandas import (
@@ -266,6 +267,7 @@ def _simple_json_normalize(
266267
return normalized_json_object
267268

268269

270+
@set_module("pandas")
269271
def json_normalize(
270272
data: dict | list[dict] | Series,
271273
record_path: str | list | None = None,

pandas/io/orc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from pandas._libs import lib
1313
from pandas.compat._optional import import_optional_dependency
14+
from pandas.util._decorators import set_module
1415
from pandas.util._validators import check_dtype_backend
1516

1617
from pandas.core.indexes.api import default_index
@@ -35,6 +36,7 @@
3536
from pandas.core.frame import DataFrame
3637

3738

39+
@set_module("pandas")
3840
def read_orc(
3941
path: FilePath | ReadBuffer[bytes],
4042
columns: list[str] | None = None,

pandas/io/parquet.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
AbstractMethodError,
2222
Pandas4Warning,
2323
)
24-
from pandas.util._decorators import doc
24+
from pandas.util._decorators import (
25+
doc,
26+
set_module,
27+
)
2528
from pandas.util._validators import check_dtype_backend
2629

2730
from pandas import (
@@ -500,6 +503,7 @@ def to_parquet(
500503
return None
501504

502505

506+
@set_module("pandas")
503507
@doc(storage_options=_shared_docs["storage_options"])
504508
def read_parquet(
505509
path: FilePath | ReadBuffer[bytes],

0 commit comments

Comments
 (0)