You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The read_sql() docs say for the new dtype argument:
dtype Type name or dict of columns
Data type for data or columns. E.g. np.float64 or {‘a’: np.float64, ‘b’: np.int32, ‘c’: ‘Int64’}. The argument is ignored if a table is passed instead of a query.
But in the typing in the source code, the argument is DtypeArg | None which doesn't allow something like {"c": "str"} . The implementation just passes dtype to DataFrame.astype().
NOTE: In pandas-stubs we did work to create all the possible strings and dtypes for astype(), so maybe that should be copied over to the pandas source??
The text was updated successfully, but these errors were encountered:
The
read_sql()
docs say for the newdtype
argument:dtype Type name or dict of columns
Data type for data or columns. E.g. np.float64 or {‘a’: np.float64, ‘b’: np.int32, ‘c’: ‘Int64’}. The argument is ignored if a table is passed instead of a query.
But in the typing in the source code, the argument is
DtypeArg | None
which doesn't allow something like{"c": "str"}
. The implementation just passesdtype
toDataFrame.astype()
.See pandas-dev/pandas-stubs#676
NOTE: In
pandas-stubs
we did work to create all the possible strings and dtypes forastype()
, so maybe that should be copied over to the pandas source??The text was updated successfully, but these errors were encountered: