Skip to content
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

ENH: Map pandas integer to optimal SQLAlchemy integer type (GH35076) #38548

Merged
merged 9 commits into from
Dec 24, 2020

Conversation

avinashpancham
Copy link
Contributor

@avinashpancham
Copy link
Contributor Author

avinashpancham commented Dec 18, 2020

Note for future reference: On windows numpy 1.16 dtype=int gives a 32 bit int, in later versions this changed to 64 bit, which is line with unix. See also https://stackoverflow.com/a/36279549/14089081

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just needs a whatsnew entry for 1.3

@@ -244,6 +244,8 @@ I/O
- Allow custom error values for parse_dates argument of :func:`read_sql`, :func:`read_sql_query` and :func:`read_sql_table` (:issue:`35185`)
- Bug in :func:`to_hdf` raising ``KeyError`` when trying to apply
for subclasses of ``DataFrame`` or ``Series`` (:issue:`33748`).
- Bug in :func:`_sqlalchemy_type` that mapped pandas integer types to non-optimal SQLAlchemy integer types (:issue:`35076`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an enhancement and should just mention that impacts to_sql

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated it

@avinashpancham avinashpancham changed the title BUG: Map pandas integer to optimal SQLAlchemy integer type (GH35076) ENH: Map pandas integer to optimal SQLAlchemy integer type (GH35076) Dec 20, 2020
@mroeschke
Copy link
Member

Mind fixing the merge conflict @avinashpancham?

@mroeschke mroeschke added this to the 1.3 milestone Dec 23, 2020
@mroeschke mroeschke added the IO SQL to_sql, read_sql, read_sql_query label Dec 23, 2020
@avinashpancham
Copy link
Contributor Author

Sure, updated it.

@avinashpancham
Copy link
Contributor Author

@mroeschke CI is greenish, only Travis gives an error due to other reasons.

@mroeschke mroeschke merged commit 08230db into pandas-dev:master Dec 24, 2020
@mroeschke
Copy link
Member

Thanks @avinashpancham

luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
…andas-dev#38548)

* BUG: Map pandas integer to optimal SQLAlchemy integer type (GH35076)

* Add conditional for default 32/64 bit integer size

* Check precision of int dtype

* Add whatsnew entry

* Update whatsnew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO SQL to_sql, read_sql, read_sql_query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Integer Capacity Higher Than Necessary in Mappings from Pandas to SQLAlchemy Types
3 participants