File tree 3 files changed +12
-3
lines changed
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ from typing import (
13
13
from pandas .core .base import PandasObject
14
14
from pandas .core .frame import DataFrame
15
15
import sqlalchemy .engine
16
+ from sqlalchemy .orm import FromStatement
16
17
import sqlalchemy .sql .expression
17
18
from typing_extensions import TypeAlias
18
19
@@ -26,7 +27,11 @@ from pandas._typing import (
26
27
_SQLConnection : TypeAlias = str | sqlalchemy .engine .Connectable | sqlite3 .Connection
27
28
28
29
_SQLStatement : TypeAlias = (
29
- str | sqlalchemy .sql .expression .Selectable | sqlalchemy .sql .expression .TextClause
30
+ str
31
+ | sqlalchemy .sql .expression .Selectable
32
+ | sqlalchemy .sql .expression .TextClause
33
+ | sqlalchemy .sql .Select
34
+ | FromStatement
30
35
)
31
36
32
37
@overload
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ types-pytz = ">= 2022.1.1"
38
38
mypy = " 1.2.0"
39
39
pyarrow = " >=10.0.1"
40
40
pytest = " >=7.1.2"
41
- pyright = " >= 1.1.305 "
41
+ pyright = " >= 1.1.306 "
42
42
poethepoet = " >=0.16.5"
43
43
loguru = " >=0.6.0"
44
44
pandas = " 2.0.1"
@@ -60,7 +60,7 @@ xarray = ">=22.6.0"
60
60
tabulate = " >=0.8.10"
61
61
jinja2 = " ^3.1"
62
62
scipy = " >=1.9.1"
63
- SQLAlchemy = " <=1.4.45 "
63
+ SQLAlchemy = " >=2.0.12 "
64
64
types-python-dateutil = " >=2.8.19"
65
65
66
66
[build-system ]
@@ -195,6 +195,7 @@ reportUnusedVariable = false
195
195
reportPrivateUsage = false
196
196
# enable optional checks
197
197
reportMissingModuleSource = true
198
+ useLibraryCodeForTypes = false
198
199
199
200
[tool .codespell ]
200
201
ignore-words-list = " indext, mose, sav, ser"
Original file line number Diff line number Diff line change @@ -1095,6 +1095,7 @@ def test_read_sql_via_sqlalchemy_connection():
1095
1095
assert_type (read_sql ("select * from test" , con = conn ), DataFrame ),
1096
1096
DataFrame ,
1097
1097
)
1098
+ engine .dispose ()
1098
1099
1099
1100
1100
1101
def test_read_sql_via_sqlalchemy_engine ():
@@ -1107,6 +1108,7 @@ def test_read_sql_via_sqlalchemy_engine():
1107
1108
assert_type (read_sql ("select * from test" , con = engine ), DataFrame ),
1108
1109
DataFrame ,
1109
1110
)
1111
+ engine .dispose ()
1110
1112
1111
1113
1112
1114
def test_read_sql_generator ():
@@ -1218,6 +1220,7 @@ def test_sqlalchemy_text() -> None:
1218
1220
assert_type (read_sql (sql_select , con = conn ), DataFrame ),
1219
1221
DataFrame ,
1220
1222
)
1223
+ engine .dispose ()
1221
1224
1222
1225
1223
1226
def test_read_sql_dtype () -> None :
You can’t perform that action at this time.
0 commit comments