Skip to content

Commit 4b9f56b

Browse files
committed
read_table, read_csv
1 parent 9757c87 commit 4b9f56b

File tree

11 files changed

+44
-59
lines changed

11 files changed

+44
-59
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_csv as read_csv,
112113
read_feather as read_feather,
113114
read_fwf as read_fwf,
114115
read_hdf as read_hdf,
@@ -118,13 +119,11 @@ from pandas.io.api import (
118119
read_spss as read_spss,
119120
read_sql_table as read_sql_table,
120121
read_stata as read_stata,
122+
read_table as read_table,
121123
)
122124
from pandas.io.api import (
123125
read_clipboard as read_clipboard, # pyright: ignore[reportUnknownVariableType]
124126
)
125-
from pandas.io.api import (
126-
read_csv as read_csv, # pyright: ignore[reportUnknownVariableType]
127-
)
128127
from pandas.io.api import (
129128
read_excel as read_excel, # pyright: ignore[reportUnknownVariableType]
130129
)
@@ -143,9 +142,6 @@ from pandas.io.api import (
143142
from pandas.io.api import (
144143
read_sql_query as read_sql_query, # pyright: ignore[reportUnknownVariableType]
145144
)
146-
from pandas.io.api import (
147-
read_table as read_table, # pyright: ignore[reportUnknownVariableType]
148-
)
149145
from pandas.io.api import (
150146
read_xml as read_xml, # pyright: ignore[reportUnknownVariableType]
151147
)

pandas-stubs/core/frame.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
18611861
@overload
18621862
def boxplot(
18631863
self,
1864-
by: Hashable | ListLikeHashable,
1864+
by: Hashable | ListLikeHashable[Hashable],
18651865
ax: PlotAxes | None = None,
18661866
fontsize: float | _str | None = None,
18671867
rot: float = 0,
@@ -1876,7 +1876,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
18761876
@overload
18771877
def boxplot(
18781878
self,
1879-
by: Hashable | ListLikeHashable,
1879+
by: Hashable | ListLikeHashable[Hashable],
18801880
ax: PlotAxes | None = None,
18811881
fontsize: float | _str | None = None,
18821882
rot: float = 0,

pandas-stubs/io/api.pyi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ from pandas.io.parquet import (
2020
read_parquet as read_parquet, # pyright: ignore[reportUnknownVariableType]
2121
)
2222
from pandas.io.parsers import (
23-
read_csv as read_csv, # pyright: ignore[reportUnknownVariableType]
24-
)
25-
from pandas.io.parsers import (
23+
read_csv as read_csv,
2624
read_fwf as read_fwf,
27-
)
28-
from pandas.io.parsers import (
29-
read_table as read_table, # pyright: ignore[reportUnknownVariableType]
25+
read_table as read_table,
3026
)
3127
from pandas.io.pickle import (
3228
read_pickle as read_pickle,

pandas-stubs/io/clipboards.pyi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from collections import defaultdict
22
from collections.abc import (
33
Callable,
4+
Hashable,
45
Sequence,
56
)
67
import csv
@@ -33,10 +34,10 @@ def read_clipboard(
3334
dtype_backend: DtypeBackend | _NoDefaultDoNotUse = ...,
3435
delimiter: str | None = ...,
3536
header: int | Sequence[int] | Literal["infer"] | None = ...,
36-
names: ListLikeHashable | None = ...,
37+
names: ListLikeHashable[Hashable] | None = ...,
3738
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
3839
usecols: UsecolsArgType = ...,
39-
dtype: DtypeArg | defaultdict | None = ...,
40+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
4041
engine: CSVEngine | None = ...,
4142
converters: dict[int | str, Callable[[str], Any]] = ...,
4243
true_values: list[str] = ...,
@@ -92,10 +93,10 @@ def read_clipboard(
9293
dtype_backend: DtypeBackend | _NoDefaultDoNotUse = ...,
9394
delimiter: str | None = ...,
9495
header: int | Sequence[int] | Literal["infer"] | None = ...,
95-
names: ListLikeHashable | None = ...,
96+
names: ListLikeHashable[Hashable] | None = ...,
9697
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
9798
usecols: UsecolsArgType = ...,
98-
dtype: DtypeArg | defaultdict | None = ...,
99+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
99100
engine: CSVEngine | None = ...,
100101
converters: dict[int | str, Callable[[str], Any]] = ...,
101102
true_values: list[str] = ...,
@@ -151,10 +152,10 @@ def read_clipboard(
151152
dtype_backend: DtypeBackend | _NoDefaultDoNotUse = ...,
152153
delimiter: str | None = ...,
153154
header: int | Sequence[int] | Literal["infer"] | None = ...,
154-
names: ListLikeHashable | None = ...,
155+
names: ListLikeHashable[Hashable] | None = ...,
155156
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
156157
usecols: UsecolsArgType = ...,
157-
dtype: DtypeArg | defaultdict | None = ...,
158+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
158159
engine: CSVEngine | None = ...,
159160
converters: dict[int | str, Callable[[str], Any]] = ...,
160161
true_values: list[str] = ...,

pandas-stubs/io/excel/_base.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def read_excel(
5252
sheet_name: list[IntStrT],
5353
*,
5454
header: int | Sequence[int] | None = ...,
55-
names: ListLikeHashable | None = ...,
55+
names: ListLikeHashable[Hashable] | None = ...,
5656
index_col: int | Sequence[int] | str | None = ...,
5757
usecols: str | UsecolsArgType = ...,
5858
dtype: str | Dtype | Mapping[str, str | Dtype] | None = ...,
@@ -95,7 +95,7 @@ def read_excel(
9595
sheet_name: None,
9696
*,
9797
header: int | Sequence[int] | None = ...,
98-
names: ListLikeHashable | None = ...,
98+
names: ListLikeHashable[Hashable] | None = ...,
9999
index_col: int | Sequence[int] | str | None = ...,
100100
usecols: str | UsecolsArgType = ...,
101101
dtype: str | Dtype | Mapping[str, str | Dtype] | None = ...,
@@ -139,7 +139,7 @@ def read_excel( # type: ignore[overload-cannot-match]
139139
sheet_name: list[int | str],
140140
*,
141141
header: int | Sequence[int] | None = ...,
142-
names: ListLikeHashable | None = ...,
142+
names: ListLikeHashable[Hashable] | None = ...,
143143
index_col: int | Sequence[int] | str | None = ...,
144144
usecols: str | UsecolsArgType = ...,
145145
dtype: str | Dtype | Mapping[str, str | Dtype] | None = ...,
@@ -182,7 +182,7 @@ def read_excel(
182182
sheet_name: int | str = ...,
183183
*,
184184
header: int | Sequence[int] | None = ...,
185-
names: ListLikeHashable | None = ...,
185+
names: ListLikeHashable[Hashable] | None = ...,
186186
index_col: int | Sequence[int] | str | None = ...,
187187
usecols: str | UsecolsArgType = ...,
188188
dtype: str | Dtype | Mapping[str, str | Dtype] | None = ...,
@@ -264,7 +264,7 @@ class ExcelFile:
264264
self,
265265
sheet_name: list[int | str] | None,
266266
header: int | Sequence[int] | None = ...,
267-
names: ListLikeHashable | None = ...,
267+
names: ListLikeHashable[Hashable] | None = ...,
268268
index_col: int | Sequence[int] | None = ...,
269269
usecols: str | UsecolsArgType = ...,
270270
converters: dict[int | str, Callable[[Any], Any]] | None = ...,
@@ -292,7 +292,7 @@ class ExcelFile:
292292
self,
293293
sheet_name: int | str,
294294
header: int | Sequence[int] | None = ...,
295-
names: ListLikeHashable | None = ...,
295+
names: ListLikeHashable[Hashable] | None = ...,
296296
index_col: int | Sequence[int] | None = ...,
297297
usecols: str | UsecolsArgType = ...,
298298
converters: dict[int | str, Callable[[Any], Any]] | None = ...,
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
from pandas.io.parsers.readers import (
22
TextFileReader as TextFileReader,
3+
read_csv as read_csv,
34
read_fwf as read_fwf,
4-
)
5-
from pandas.io.parsers.readers import (
6-
read_csv as read_csv, # pyright: ignore[reportUnknownVariableType]
7-
)
8-
from pandas.io.parsers.readers import (
9-
read_table as read_table, # pyright: ignore[reportUnknownVariableType]
5+
read_table as read_table,
106
)

pandas-stubs/io/parsers/readers.pyi

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ def read_csv(
4141
sep: str | None = ...,
4242
delimiter: str | None = None,
4343
header: int | Sequence[int] | Literal["infer"] | None = "infer",
44-
names: ListLikeHashable | None = ...,
44+
names: ListLikeHashable[Hashable] | None = ...,
4545
index_col: int | str | Sequence[str | int] | Literal[False] | None = None,
4646
usecols: UsecolsArgType[HashableT] = None,
47-
dtype: DtypeArg | defaultdict | None = None,
47+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = None,
4848
engine: CSVEngine | None = None,
4949
converters: (
5050
Mapping[int | str, Callable[[str], Any]]
@@ -104,10 +104,10 @@ def read_csv(
104104
sep: str | None = ...,
105105
delimiter: str | None = None,
106106
header: int | Sequence[int] | Literal["infer"] | None = "infer",
107-
names: ListLikeHashable | None = ...,
107+
names: ListLikeHashable[Hashable] | None = ...,
108108
index_col: int | str | Sequence[str | int] | Literal[False] | None = None,
109109
usecols: UsecolsArgType[HashableT] = None,
110-
dtype: DtypeArg | defaultdict | None = None,
110+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = None,
111111
engine: CSVEngine | None = None,
112112
converters: (
113113
Mapping[int | str, Callable[[str], Any]]
@@ -167,10 +167,10 @@ def read_csv(
167167
sep: str | None = ...,
168168
delimiter: str | None = ...,
169169
header: int | Sequence[int] | Literal["infer"] | None = ...,
170-
names: ListLikeHashable | None = ...,
170+
names: ListLikeHashable[Hashable] | None = ...,
171171
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
172172
usecols: UsecolsArgType[HashableT] = ...,
173-
dtype: DtypeArg | defaultdict | None = ...,
173+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
174174
engine: CSVEngine | None = ...,
175175
converters: (
176176
Mapping[int | str, Callable[[str], Any]]
@@ -230,10 +230,10 @@ def read_table(
230230
sep: str | None = ...,
231231
delimiter: str | None = None,
232232
header: int | Sequence[int] | Literal["infer"] | None = "infer",
233-
names: ListLikeHashable | None = ...,
233+
names: ListLikeHashable[Hashable] | None = ...,
234234
index_col: int | str | Sequence[str | int] | Literal[False] | None = None,
235235
usecols: UsecolsArgType[HashableT] = None,
236-
dtype: DtypeArg | defaultdict | None = None,
236+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = None,
237237
engine: CSVEngine | None = None,
238238
converters: (
239239
Mapping[int | str, Callable[[str], Any]]
@@ -293,10 +293,10 @@ def read_table(
293293
sep: str | None = ...,
294294
delimiter: str | None = None,
295295
header: int | Sequence[int] | Literal["infer"] | None = "infer",
296-
names: ListLikeHashable | None = ...,
296+
names: ListLikeHashable[Hashable] | None = ...,
297297
index_col: int | str | Sequence[str | int] | Literal[False] | None = None,
298298
usecols: UsecolsArgType[HashableT] = None,
299-
dtype: DtypeArg | defaultdict | None = None,
299+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = None,
300300
engine: CSVEngine | None = None,
301301
converters: (
302302
Mapping[int | str, Callable[[str], Any]]
@@ -356,10 +356,10 @@ def read_table(
356356
sep: str | None = ...,
357357
delimiter: str | None = None,
358358
header: int | Sequence[int] | Literal["infer"] | None = "infer",
359-
names: ListLikeHashable | None = ...,
359+
names: ListLikeHashable[Hashable] | None = ...,
360360
index_col: int | str | Sequence[str | int] | Literal[False] | None = None,
361361
usecols: UsecolsArgType[HashableT] = None,
362-
dtype: DtypeArg | defaultdict | None = None,
362+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = None,
363363
engine: CSVEngine | None = None,
364364
converters: (
365365
Mapping[int | str, Callable[[str], Any]]

pandas-stubs/io/sql.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _SQLStatement: TypeAlias = (
3434
| sqlalchemy.sql.expression.Selectable
3535
| sqlalchemy.sql.expression.TextClause
3636
| sqlalchemy.sql.Select
37-
| FromStatement
37+
| FromStatement[Any]
3838
| sqlalchemy.sql.expression.UpdateBase
3939
)
4040

pandas-stubs/plotting/__init__.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from pandas.plotting._core import (
22
PlotAccessor as PlotAccessor,
3-
)
4-
from pandas.plotting._core import (
5-
boxplot as boxplot, # pyright: ignore[reportUnknownVariableType]
3+
boxplot as boxplot,
64
)
75
from pandas.plotting._misc import (
86
andrews_curves as andrews_curves,

pandas-stubs/plotting/_core.pyi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ _PlotAccessorColor: TypeAlias = str | list[_SingleColor] | dict[HashableT, _Sing
4545
@overload
4646
def boxplot(
4747
data: DataFrame,
48-
column: Hashable | ListLikeHashable,
48+
column: Hashable | ListLikeHashable[Hashable],
4949
by: None = None,
5050
ax: Axes | None = None,
5151
fontsize: float | str | None = None,
@@ -61,7 +61,7 @@ def boxplot(
6161
@overload
6262
def boxplot(
6363
data: DataFrame,
64-
column: Hashable | ListLikeHashable,
64+
column: Hashable | ListLikeHashable[Hashable],
6565
by: None = None,
6666
ax: Axes | None = None,
6767
fontsize: float | str | None = None,
@@ -77,7 +77,7 @@ def boxplot(
7777
@overload
7878
def boxplot(
7979
data: DataFrame,
80-
column: Hashable | ListLikeHashable,
80+
column: Hashable | ListLikeHashable[Hashable],
8181
by: None = None,
8282
ax: Axes | None = None,
8383
fontsize: float | str | None = None,
@@ -93,8 +93,8 @@ def boxplot(
9393
@overload
9494
def boxplot(
9595
data: DataFrame,
96-
column: Hashable | ListLikeHashable,
97-
by: Hashable | ListLikeHashable,
96+
column: Hashable | ListLikeHashable[Hashable],
97+
by: Hashable | ListLikeHashable[Hashable],
9898
ax: Axes | None = None,
9999
fontsize: float | str | None = None,
100100
rot: float = 0,
@@ -109,8 +109,8 @@ def boxplot(
109109
@overload
110110
def boxplot(
111111
data: DataFrame,
112-
column: Hashable | ListLikeHashable,
113-
by: Hashable | ListLikeHashable,
112+
column: Hashable | ListLikeHashable[Hashable],
113+
by: Hashable | ListLikeHashable[Hashable],
114114
ax: Axes | None = None,
115115
fontsize: float | str | None = None,
116116
rot: float = 0,

0 commit comments

Comments
 (0)