Skip to content

Commit e27c1b2

Browse files
committed
read_clipboard, read_xml
1 parent 18bcce0 commit e27c1b2

File tree

6 files changed

+20
-27
lines changed

6 files changed

+20
-27
lines changed

pandas-stubs/__init__.pyi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ from pandas.io.api import (
109109
ExcelFile as ExcelFile,
110110
ExcelWriter as ExcelWriter,
111111
HDFStore as HDFStore,
112+
read_clipboard as read_clipboard,
112113
read_csv as read_csv,
113114
read_feather as read_feather,
114115
read_fwf as read_fwf,
@@ -120,9 +121,7 @@ from pandas.io.api import (
120121
read_sql_table as read_sql_table,
121122
read_stata as read_stata,
122123
read_table as read_table,
123-
)
124-
from pandas.io.api import (
125-
read_clipboard as read_clipboard, # pyright: ignore[reportUnknownVariableType]
124+
read_xml as read_xml,
126125
)
127126
from pandas.io.api import (
128127
read_excel as read_excel, # pyright: ignore[reportUnknownVariableType]
@@ -142,9 +141,6 @@ from pandas.io.api import (
142141
from pandas.io.api import (
143142
read_sql_query as read_sql_query, # pyright: ignore[reportUnknownVariableType]
144143
)
145-
from pandas.io.api import (
146-
read_xml as read_xml, # pyright: ignore[reportUnknownVariableType]
147-
)
148144
from pandas.io.json._normalize import (
149145
json_normalize as json_normalize, # pyright: ignore[reportUnknownVariableType]
150146
)

pandas-stubs/io/api.pyi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from pandas.io.clipboards import (
2-
read_clipboard as read_clipboard, # pyright: ignore[reportUnknownVariableType]
3-
)
1+
from pandas.io.clipboards import read_clipboard as read_clipboard
42
from pandas.io.excel import (
53
ExcelFile as ExcelFile,
64
ExcelWriter as ExcelWriter,
@@ -43,6 +41,4 @@ from pandas.io.sql import (
4341
read_sql_table as read_sql_table,
4442
)
4543
from pandas.io.stata import read_stata as read_stata
46-
from pandas.io.xml import (
47-
read_xml as read_xml, # pyright: ignore[reportUnknownVariableType]
48-
)
44+
from pandas.io.xml import read_xml as read_xml

pandas-stubs/io/clipboards.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def read_clipboard(
3636
header: int | Sequence[int] | Literal["infer"] | None = ...,
3737
names: ListLikeHashable[Hashable] | None = ...,
3838
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
39-
usecols: UsecolsArgType = ...,
39+
usecols: UsecolsArgType[Any] = ...,
4040
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
4141
engine: CSVEngine | None = ...,
4242
converters: dict[int | str, Callable[[str], Any]] = ...,
@@ -95,7 +95,7 @@ def read_clipboard(
9595
header: int | Sequence[int] | Literal["infer"] | None = ...,
9696
names: ListLikeHashable[Hashable] | None = ...,
9797
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
98-
usecols: UsecolsArgType = ...,
98+
usecols: UsecolsArgType[Any] = ...,
9999
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
100100
engine: CSVEngine | None = ...,
101101
converters: dict[int | str, Callable[[str], Any]] = ...,
@@ -154,7 +154,7 @@ def read_clipboard(
154154
header: int | Sequence[int] | Literal["infer"] | None = ...,
155155
names: ListLikeHashable[Hashable] | None = ...,
156156
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
157-
usecols: UsecolsArgType = ...,
157+
usecols: UsecolsArgType[Any] = ...,
158158
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
159159
engine: CSVEngine | None = ...,
160160
converters: dict[int | str, Callable[[str], Any]] = ...,

pandas-stubs/io/excel/_base.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def read_excel(
5454
header: int | Sequence[int] | None = ...,
5555
names: ListLikeHashable[Hashable] | None = ...,
5656
index_col: int | Sequence[int] | str | None = ...,
57-
usecols: str | UsecolsArgType = ...,
57+
usecols: str | UsecolsArgType[Any] = ...,
5858
dtype: str | Dtype | Mapping[str, str | Dtype] | None = ...,
5959
engine: ExcelReadEngine | None = ...,
6060
converters: Mapping[int | str, Callable[[Any], Any]] | None = ...,
@@ -97,7 +97,7 @@ def read_excel(
9797
header: int | Sequence[int] | None = ...,
9898
names: ListLikeHashable[Hashable] | None = ...,
9999
index_col: int | Sequence[int] | str | None = ...,
100-
usecols: str | UsecolsArgType = ...,
100+
usecols: str | UsecolsArgType[Any] = ...,
101101
dtype: str | Dtype | Mapping[str, str | Dtype] | None = ...,
102102
engine: ExcelReadEngine | None = ...,
103103
converters: Mapping[int | str, Callable[[Any], Any]] | None = ...,
@@ -141,7 +141,7 @@ def read_excel( # type: ignore[overload-cannot-match]
141141
header: int | Sequence[int] | None = ...,
142142
names: ListLikeHashable[Hashable] | None = ...,
143143
index_col: int | Sequence[int] | str | None = ...,
144-
usecols: str | UsecolsArgType = ...,
144+
usecols: str | UsecolsArgType[Any] = ...,
145145
dtype: str | Dtype | Mapping[str, str | Dtype] | None = ...,
146146
engine: ExcelReadEngine | None = ...,
147147
converters: Mapping[int | str, Callable[[Any], Any]] | None = ...,
@@ -184,7 +184,7 @@ def read_excel(
184184
header: int | Sequence[int] | None = ...,
185185
names: ListLikeHashable[Hashable] | None = ...,
186186
index_col: int | Sequence[int] | str | None = ...,
187-
usecols: str | UsecolsArgType = ...,
187+
usecols: str | UsecolsArgType[Any] = ...,
188188
dtype: str | Dtype | Mapping[str, str | Dtype] | None = ...,
189189
engine: ExcelReadEngine | None = ...,
190190
converters: Mapping[int | str, Callable[[Any], Any]] | None = ...,
@@ -266,7 +266,7 @@ class ExcelFile:
266266
header: int | Sequence[int] | None = ...,
267267
names: ListLikeHashable[Hashable] | None = ...,
268268
index_col: int | Sequence[int] | None = ...,
269-
usecols: str | UsecolsArgType = ...,
269+
usecols: str | UsecolsArgType[Any] = ...,
270270
converters: dict[int | str, Callable[[Any], Any]] | None = ...,
271271
true_values: Iterable[Hashable] | None = ...,
272272
false_values: Iterable[Hashable] | None = ...,
@@ -294,7 +294,7 @@ class ExcelFile:
294294
header: int | Sequence[int] | None = ...,
295295
names: ListLikeHashable[Hashable] | None = ...,
296296
index_col: int | Sequence[int] | None = ...,
297-
usecols: str | UsecolsArgType = ...,
297+
usecols: str | UsecolsArgType[Any] = ...,
298298
converters: dict[int | str, Callable[[Any], Any]] | None = ...,
299299
true_values: Iterable[Hashable] | None = ...,
300300
false_values: Iterable[Hashable] | None = ...,

pandas-stubs/io/xml.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from collections.abc import Sequence
1+
from collections.abc import (
2+
Hashable,
3+
Sequence,
4+
)
25

36
from pandas.core.frame import DataFrame
47

@@ -25,7 +28,7 @@ def read_xml(
2528
names: Sequence[str] | None = ...,
2629
dtype: DtypeArg | None = ...,
2730
converters: ConvertersArg | None = ...,
28-
parse_dates: ParseDatesArg | None = ...,
31+
parse_dates: ParseDatesArg[Hashable, Hashable] | None = ...,
2932
# encoding can not be None for lxml and StringIO input
3033
encoding: str | None = ...,
3134
parser: XMLParsers = ...,

tests/test_io.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@
4444
)
4545
from tests import NUMPY20 # See https://github.com/PyTables/PyTables/issues/1172
4646

47-
from pandas.io.clipboards import (
48-
read_clipboard, # pyright: ignore[reportUnknownVariableType]
49-
)
47+
from pandas.io.clipboards import read_clipboard
5048
from pandas.io.excel._base import (
5149
read_excel, # pyright: ignore[reportUnknownVariableType]
5250
)
@@ -67,7 +65,7 @@
6765
from pandas.io.sql import read_sql # pyright: ignore[reportUnknownVariableType]
6866
from pandas.io.sql import read_sql_query # pyright: ignore[reportUnknownVariableType]
6967
from pandas.io.stata import StataReader
70-
from pandas.io.xml import read_xml # pyright: ignore[reportUnknownVariableType]
68+
from pandas.io.xml import read_xml
7169

7270
DF = DataFrame({"a": [1, 2, 3], "b": [0.0, 0.0, 0.0]})
7371
CWD = Path(__file__).parent.resolve()

0 commit comments

Comments
 (0)