Skip to content

Commit 6346376

Browse files
committed
read_sql, read_sql_query
1 parent 8cd3546 commit 6346376

File tree

5 files changed

+14
-21
lines changed

5 files changed

+14
-21
lines changed

pandas-stubs/__init__.pyi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ from pandas.io.api import (
123123
read_pickle as read_pickle,
124124
read_sas as read_sas,
125125
read_spss as read_spss,
126+
read_sql as read_sql,
127+
read_sql_query as read_sql_query,
126128
read_sql_table as read_sql_table,
127129
read_stata as read_stata,
128130
read_table as read_table,
@@ -134,12 +136,6 @@ from pandas.io.api import (
134136
from pandas.io.api import (
135137
read_orc as read_orc, # pyright: ignore[reportUnknownVariableType]
136138
)
137-
from pandas.io.api import (
138-
read_sql as read_sql, # pyright: ignore[reportUnknownVariableType]
139-
)
140-
from pandas.io.api import (
141-
read_sql_query as read_sql_query, # pyright: ignore[reportUnknownVariableType]
142-
)
143139
from pandas.io.json._normalize import (
144140
json_normalize as json_normalize, # pyright: ignore[reportUnknownVariableType]
145141
)

pandas-stubs/io/api.pyi

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ from pandas.io.pytables import (
2828
from pandas.io.sas import read_sas as read_sas
2929
from pandas.io.spss import read_spss as read_spss
3030
from pandas.io.sql import (
31-
read_sql as read_sql, # pyright: ignore[reportUnknownVariableType]
32-
)
33-
from pandas.io.sql import (
34-
read_sql_query as read_sql_query, # pyright: ignore[reportUnknownVariableType]
35-
)
36-
from pandas.io.sql import (
31+
read_sql as read_sql,
32+
read_sql_query as read_sql_query,
3733
read_sql_table as read_sql_table,
3834
)
3935
from pandas.io.stata import read_stata as read_stata

pandas-stubs/io/parquet.pyi

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from collections.abc import Sequence
12
from typing import (
23
Any,
3-
Literal,
44
TypeAlias,
55
)
66

@@ -14,8 +14,7 @@ from pandas._typing import (
1414
StorageOptions,
1515
)
1616

17-
_OP: TypeAlias = Literal["==", "=", ">", ">=", "<", "<=", "!=", "in", "not in"]
18-
_FILTER: TypeAlias = tuple[str, _OP, Any]
17+
_Filter: TypeAlias = tuple[str, str, Any]
1918

2019
def read_parquet(
2120
path: FilePath | ReadBuffer[bytes],
@@ -24,6 +23,6 @@ def read_parquet(
2423
storage_options: StorageOptions = None,
2524
dtype_backend: DtypeBackend = "numpy_nullable",
2625
filesystem: Any = None,
27-
filters: list[_FILTER] | list[list[_FILTER]] | None = None,
26+
filters: Sequence[_Filter] | Sequence[Sequence[_Filter]] | None = None,
2827
**kwargs: Any,
2928
) -> DataFrame: ...

pandas-stubs/io/sql.pyi

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

tests/test_io.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
from pandas.io.excel._base import (
4949
read_excel, # pyright: ignore[reportUnknownVariableType]
5050
)
51-
from pandas.io.html import read_html # pyright: ignore[reportUnknownVariableType]
51+
from pandas.io.html import read_html
5252
from pandas.io.orc import read_orc # pyright: ignore[reportUnknownVariableType]
53-
from pandas.io.parquet import read_parquet # pyright: ignore[reportUnknownVariableType]
53+
from pandas.io.parquet import read_parquet
5454
from pandas.io.parsers import TextFileReader
5555
from pandas.io.parsers.readers import (
5656
read_csv,
@@ -62,8 +62,10 @@
6262
)
6363
from pandas.io.sas.sas7bdat import SAS7BDATReader
6464
from pandas.io.sas.sas_xport import XportReader
65-
from pandas.io.sql import read_sql # pyright: ignore[reportUnknownVariableType]
66-
from pandas.io.sql import read_sql_query # pyright: ignore[reportUnknownVariableType]
65+
from pandas.io.sql import (
66+
read_sql,
67+
read_sql_query,
68+
)
6769
from pandas.io.stata import StataReader
6870
from pandas.io.xml import read_xml
6971

0 commit comments

Comments
 (0)