Skip to content

BUG: fix multiple columns as primary key in io.sql.get_schema (GH10385) #10386

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

Merged

Conversation

jorisvandenbossche
Copy link
Member

Closes #10385

@jorisvandenbossche jorisvandenbossche added Bug IO SQL to_sql, read_sql, read_sql_query labels Jun 18, 2015
@jorisvandenbossche jorisvandenbossche added this to the 0.17.0 milestone Jun 18, 2015
@jorisvandenbossche jorisvandenbossche force-pushed the get-schema-keys branch 2 times, most recently from de9e1cb to 38177c9 Compare June 18, 2015 14:41
@jorisvandenbossche
Copy link
Member Author

Apparantly there was also an bug in the fallback version, it could only handle single character column names ...

@artemyk time we clean this up :-) (I will try to look at your ideas on get_schema and others next week!)

@jorisvandenbossche
Copy link
Member Author

@jreback any remarks?

@@ -834,7 +834,11 @@ def _create_table_setup(self):
for name, typ, is_index in column_names_and_types]

if self.keys is not None:
pkc = PrimaryKeyConstraint(self.keys, name=self.name + '_pk')
if isinstance(self.keys, string_types):
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe you want to ensure list-like first com.is_list_like, then stringify? (then you can join by ',' if necessary)

jorisvandenbossche added a commit that referenced this pull request Jul 3, 2015
BUG: fix multiple columns as primary key in io.sql.get_schema (GH10385)
@jorisvandenbossche jorisvandenbossche merged commit bac025f into pandas-dev:master Jul 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO SQL to_sql, read_sql, read_sql_query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants