Skip to content

Commit

Permalink
fix: make get_pk_constraint adhere to SqlAlchemy specs (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored Mar 19, 2020
1 parent c925457 commit 466faee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sqla_vertica_python/vertica_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,12 @@ def get_pk_constraint(self, connection, table_name, schema=None, **kw):
query += " AND table_schema = '" + schema + "' \n"

cols = set()
name = set()
name = None
for row in connection.execute(query):
name.add(row[1])
name = row[1] if name is None else name
cols.add(row[2])

return {"constrained_columns": cols, "name": name}
return {"constrained_columns": list(cols), "name": name}


def get_foreign_keys(self, connection, table_name, schema, **kw):
Expand Down

0 comments on commit 466faee

Please sign in to comment.