-
-
Notifications
You must be signed in to change notification settings - Fork 141
read_sql_*
methods should accept dtype
argument with same type as DataFrame.astype()
#676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ramvikrams can you fix this? You added the argument before, so maybe you can do this? |
Thank you @Dr-Irv I will surely do it |
The solution here is actually simpler than I thought. Try changing pandas-stubs/pandas-stubs/_typing.pyi Line 79 in 6c0eed6
Mapping instead of dict , and then just add a test that has a string in the value of the dict.
|
i'll do it via this way then |
* GH-676 * Update test_io.py * Update tests/test_io.py Co-authored-by: Irv Lustig <[email protected]> * Update test_io.py --------- Co-authored-by: Irv Lustig <[email protected]>
…l` (#695) * GH-676 * Update test_io.py * Update tests/test_io.py Co-authored-by: Irv Lustig <[email protected]> * Update test_io.py * added `date_format` to `read_table`,`read_fwf` and `read_excel` * req changes * Update test_io.py * Update test_io.py * made `date_format` consistent and changed the tests --------- Co-authored-by: Irv Lustig <[email protected]>
For the
read_sql_*
methods, the argumentdtype
is just passed toDataFrame.astype()
, where we allowdtype: AstypeArg | Mapping[Any, Dtype] | Series
, so theread_sql_*()
methods should do the same.In particular, doing something like
dtype: {"col": "str"}
is totally allowed, but not permitted in the stubs.pandas-stubs version 2.0.1.230501
The text was updated successfully, but these errors were encountered: