@@ -2,37 +2,68 @@ from __future__ import annotations
2
2
3
3
from typing import (
4
4
Any ,
5
+ Callable ,
6
+ Hashable ,
7
+ Iterator ,
5
8
Mapping ,
6
9
Sequence ,
10
+ overload ,
7
11
)
8
12
9
- from pandas .core .base import PandasObject
10
13
from pandas .core .frame import DataFrame
11
14
15
+ from pandas ._typing import DtypeArg
16
+
12
17
class SQLAlchemyRequired (ImportError ): ...
13
18
class DatabaseError (IOError ): ...
14
19
15
- def execute ( sql , con , cur = ..., params = ...): ...
20
+ @ overload
16
21
def read_sql_table (
17
22
table_name : str ,
18
- con ,
23
+ con : str | Any ,
19
24
schema : str | None = ...,
20
25
index_col : str | Sequence [str ] | None = ...,
21
26
coerce_float : bool = ...,
22
27
parse_dates : Sequence [str ] | Mapping [str , str ] | None = ...,
23
28
columns : Sequence [str ] | None = ...,
24
- chunksize : int | None = ...,
29
+ chunksize : None = ...,
25
30
) -> DataFrame : ...
26
- def read_sql_query (
27
- sql ,
28
- con ,
31
+ @overload
32
+ def read_sql_table (
33
+ table_name : str ,
34
+ con : str | Any ,
29
35
schema : str | None = ...,
30
36
index_col : str | Sequence [str ] | None = ...,
31
37
coerce_float : bool = ...,
38
+ parse_dates : Sequence [str ] | Mapping [str , str ] | None = ...,
39
+ columns : Sequence [str ] | None = ...,
40
+ * ,
41
+ chunksize : int ,
42
+ ) -> Iterator [DataFrame ]: ...
43
+ @overload
44
+ def read_sql_query (
45
+ sql : str | Any ,
46
+ con : str | Any ,
47
+ index_col : str | Sequence [str ] | None = ...,
48
+ coerce_float : bool = ...,
32
49
params = ...,
33
50
parse_dates : Sequence [str ] | Mapping [str , str ] | None = ...,
34
- chunksize : int | None = ...,
51
+ chunksize : None = ...,
52
+ dtype : DtypeArg | None = ...,
35
53
) -> DataFrame : ...
54
+ @overload
55
+ def read_sql_query (
56
+ sql : str | Any ,
57
+ con : str | Any ,
58
+ index_col : str | Sequence [str ] | None = ...,
59
+ coerce_float : bool = ...,
60
+ params = ...,
61
+ parse_dates : Sequence [str ] | Mapping [str , str ] | None = ...,
62
+ * ,
63
+ chunksize : int ,
64
+ dtype : DtypeArg | None = ...,
65
+ ) -> Iterator [DataFrame ]: ...
66
+ @overload
36
67
def read_sql (
37
68
sql : str | Any ,
38
69
con : str | Any = ...,
@@ -44,151 +75,34 @@ def read_sql(
44
75
| Mapping [str , Mapping [str , Any ]]
45
76
| None = ...,
46
77
columns : Sequence [str ] = ...,
47
- chunksize : int = ...,
78
+ chunksize : None = ...,
48
79
) -> DataFrame : ...
80
+ @overload
81
+ def read_sql (
82
+ sql : str | Any ,
83
+ con : str | Any = ...,
84
+ index_col : str | Sequence [str ] | None = ...,
85
+ coerce_float : bool = ...,
86
+ params : Sequence [str ] | tuple [str , ...] | Mapping [str , str ] | None = ...,
87
+ parse_dates : Sequence [str ]
88
+ | Mapping [str , str ]
89
+ | Mapping [str , Mapping [str , Any ]]
90
+ | None = ...,
91
+ columns : Sequence [str ] = ...,
92
+ * ,
93
+ chunksize : int ,
94
+ ) -> Iterator [DataFrame ]: ...
49
95
def to_sql (
50
- frame ,
51
- name ,
52
- con ,
53
- schema = ...,
96
+ frame : DataFrame ,
97
+ name : str ,
98
+ con : Any ,
99
+ schema : str | None = ...,
54
100
if_exists : str = ...,
55
101
index : bool = ...,
56
- index_label = ...,
57
- chunksize = ...,
58
- dtype = ...,
59
- method = ...,
60
- ) -> None : ...
61
- def has_table (table_name , con , schema = ...): ...
62
-
63
- table_exists = has_table
64
-
65
- def pandasSQL_builder (con , schema = ..., meta = ..., is_cursor : bool = ...): ...
66
-
67
- class SQLTable (PandasObject ):
68
- name = ...
69
- pd_sql = ...
70
- prefix = ...
71
- frame = ...
72
- index = ...
73
- schema = ...
74
- if_exists = ...
75
- keys = ...
76
- dtype = ...
77
- table = ...
78
- def __init__ (
79
- self ,
80
- name ,
81
- pandas_sql_engine ,
82
- frame = ...,
83
- index : bool = ...,
84
- if_exists : str = ...,
85
- prefix : str = ...,
86
- index_label = ...,
87
- schema = ...,
88
- keys = ...,
89
- dtype = ...,
90
- ) -> None : ...
91
- def exists (self ): ...
92
- def sql_schema (self ): ...
93
- def create (self ) -> None : ...
94
- def insert_data (self ): ...
95
- def insert (self , chunksize = ..., method = ...) -> None : ...
96
- def read (
97
- self , coerce_float : bool = ..., parse_dates = ..., columns = ..., chunksize = ...
98
- ): ...
99
-
100
- class PandasSQL (PandasObject ):
101
- def read_sql (self , * args , ** kwargs ) -> None : ...
102
- def to_sql (
103
- self ,
104
- frame ,
105
- name ,
106
- if_exists : str = ...,
107
- index : bool = ...,
108
- index_label = ...,
109
- schema = ...,
110
- chunksize = ...,
111
- dtype = ...,
112
- method = ...,
113
- ) -> None : ...
114
-
115
- class SQLDatabase (PandasSQL ):
116
- connectable = ...
117
- meta = ...
118
- def __init__ (self , engine , schema = ..., meta = ...) -> None : ...
119
- def run_transaction (self ) -> None : ...
120
- def execute (self , * args , ** kwargs ): ...
121
- def read_table (
122
- self ,
123
- table_name ,
124
- index_col = ...,
125
- coerce_float : bool = ...,
126
- parse_dates = ...,
127
- columns = ...,
128
- schema = ...,
129
- chunksize = ...,
130
- ): ...
131
- def read_query (
132
- self ,
133
- sql ,
134
- index_col = ...,
135
- coerce_float : bool = ...,
136
- parse_dates = ...,
137
- params = ...,
138
- chunksize = ...,
139
- ): ...
140
- def to_sql (
141
- self ,
142
- frame ,
143
- name ,
144
- if_exists : str = ...,
145
- index : bool = ...,
146
- index_label = ...,
147
- schema = ...,
148
- chunksize = ...,
149
- dtype = ...,
150
- method = ...,
151
- ) -> None : ...
152
- @property
153
- def tables (self ): ...
154
- def has_table (self , name , schema = ...): ...
155
- def get_table (self , table_name , schema = ...): ...
156
- def drop_table (self , table_name , schema = ...) -> None : ...
157
-
158
- class SQLiteTable (SQLTable ):
159
- def __init__ (self , * args , ** kwargs ): ...
160
- def sql_schema (self ): ...
161
- def insert_statement (self ): ...
162
-
163
- class SQLiteDatabase (PandasSQL ):
164
- is_cursor = ...
165
- con = ...
166
- def __init__ (self , con , is_cursor : bool = ...) -> None : ...
167
- def run_transaction (self ) -> None : ...
168
- def execute (self , * args , ** kwargs ): ...
169
- def read_query (
170
- self ,
171
- sql ,
172
- index_col = ...,
173
- coerce_float : bool = ...,
174
- params = ...,
175
- parse_dates = ...,
176
- chunksize = ...,
177
- ): ...
178
- def to_sql (
179
- self ,
180
- frame ,
181
- name ,
182
- if_exists : str = ...,
183
- index : bool = ...,
184
- index_label = ...,
185
- schema = ...,
186
- chunksize = ...,
187
- dtype = ...,
188
- method = ...,
189
- ) -> None : ...
190
- def has_table (self , name , schema = ...): ...
191
- def get_table (self , table_name , schema = ...) -> None : ...
192
- def drop_table (self , name , schema = ...) -> None : ...
193
-
194
- def get_schema (frame , name , keys = ..., con = ..., dtype = ...): ...
102
+ index_label : Hashable | Sequence [Hashable ] | None = ...,
103
+ chunksize : int | None = ...,
104
+ dtype : DtypeArg | None = ...,
105
+ method : str | Callable | None = ...,
106
+ engine : str = ...,
107
+ ** engine_kwargs ,
108
+ ) -> int | None : ...
0 commit comments