-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Add dtype to read sql to be consistent with read_sql_query #50797
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
Conversation
@@ -659,6 +668,7 @@ def read_sql( | |||
parse_dates=parse_dates, | |||
chunksize=chunksize, | |||
use_nullable_dtypes=use_nullable_dtypes, | |||
dtype=dtype, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this interact with use_nullable_dtypes
when dtype
is not a nullable type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add tests for this :)
Right now we are casting to nullable and then apply astype (that's how it was implemented before as well). But I don't think that we have any tests covering this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah would be good to add tests for this case. IIRC read_csv
or a similar reader had a similar thing. This should hopefully operate similarly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
Thanks @phofl |
…as-dev#50797) * ENH: Add dtype to read sql to be consistent with read_sql_query * Add gh ref * Fix docstring * Add test
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Came across this, seemed odd to me that one supports it but not the other