7
7
from datetime import date , datetime , time
8
8
from functools import partial
9
9
import re
10
- from typing import Iterator , Optional , Union , overload
10
+ from typing import Dict , Iterator , Optional , Union , overload
11
11
import warnings
12
12
13
13
import numpy as np
@@ -301,7 +301,7 @@ def read_sql_query(
301
301
params = None ,
302
302
parse_dates = None ,
303
303
chunksize : None = None ,
304
- dtype : Optional [Dtype ] = None ,
304
+ dtype : Optional [Union [ Dtype , Dict [ str , Dtype ]] ] = None ,
305
305
) -> DataFrame :
306
306
...
307
307
@@ -315,7 +315,7 @@ def read_sql_query(
315
315
params = None ,
316
316
parse_dates = None ,
317
317
chunksize : int = 1 ,
318
- dtype : Optional [Dtype ] = None ,
318
+ dtype : Optional [Union [ Dtype , Dict [ str , Dtype ]] ] = None ,
319
319
) -> Iterator [DataFrame ]:
320
320
...
321
321
@@ -328,7 +328,7 @@ def read_sql_query(
328
328
params = None ,
329
329
parse_dates = None ,
330
330
chunksize : Optional [int ] = None ,
331
- dtype : Optional [Dtype ] = None ,
331
+ dtype : Optional [Union [ Dtype , Dict [ str , Dtype ]] ] = None ,
332
332
) -> Union [DataFrame , Iterator [DataFrame ]]:
333
333
"""
334
334
Read SQL query into a DataFrame.
@@ -367,6 +367,9 @@ def read_sql_query(
367
367
chunksize : int, default None
368
368
If specified, return an iterator where `chunksize` is the number of
369
369
rows to include in each chunk.
370
+ dtype : Type name or dict of columns
371
+ Data type for data or columns. E.g. np.float64 or
372
+ {‘a’: np.float64, ‘b’: np.int32, ‘c’: ‘Int64’}
370
373
371
374
Returns
372
375
-------
0 commit comments