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: add "schema" kwarg to io.sql.get_schema method #38146

Merged
merged 15 commits into from
Dec 8, 2020

Conversation

arw2019
Copy link
Member

@arw2019 arw2019 commented Nov 29, 2020

Picking up #33278

@arw2019 arw2019 changed the title Gh28486 add schema kwarg ENH: add "schema" kwarg to io.sql.get_schema method Nov 29, 2020
@jreback jreback added the IO SQL to_sql, read_sql, read_sql_query label Nov 29, 2020
@jreback jreback added this to the 1.2 milestone Nov 29, 2020
@jreback
Copy link
Contributor

jreback commented Nov 29, 2020

lgtm. @jorisvandenbossche if you can give a once over

@jreback
Copy link
Contributor

jreback commented Dec 3, 2020

cc @jorisvandenbossche

@arw2019 arw2019 closed this Dec 5, 2020
@arw2019 arw2019 reopened this Dec 5, 2020
@@ -260,6 +260,7 @@ Other enhancements
- Added :meth:`~DataFrame.set_flags` for setting table-wide flags on a Series or DataFrame (:issue:`28394`)
- :meth:`DataFrame.applymap` now supports ``na_action`` (:issue:`23803`)
- :class:`Index` with object dtype supports division and multiplication (:issue:`34160`)
- :meth:`get_schema` now allows a schema kwarg that will add a schema into the create table statement (:issue:`28486`)
Copy link
Member

Choose a reason for hiding this comment

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

Mind specifying io.sql.get_schema directly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure! Done

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.

One minor comment otherwise LGTM

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

ping on green

@@ -1873,4 +1896,6 @@ def get_schema(frame, name, keys=None, con=None, dtype=None):

"""
pandas_sql = pandasSQL_builder(con=con)
return pandas_sql._create_sql_schema(frame, name, keys=keys, dtype=dtype)
return pandas_sql._create_sql_schema(
Copy link
Contributor

Choose a reason for hiding this comment

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

oh you need to update doc-string and add versionadded 1.2

@jreback
Copy link
Contributor

jreback commented Dec 7, 2020

lgtm ping on green

@arw2019
Copy link
Member Author

arw2019 commented Dec 7, 2020

Green

@mroeschke mroeschke merged commit 6a1305e into pandas-dev:master Dec 8, 2020
@mroeschke
Copy link
Member

Thanks @arw2019

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.

Add support for schema parameter when calling io.sql.get_schema
4 participants