Skip to content
This repository was archived by the owner on May 5, 2022. It is now read-only.

Commit c5be8a4

Browse files
committed
fix: get_primary_keys return only list of pk columns
1 parent 111e02c commit c5be8a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sqlalchemy_trino/dialect.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ def get_pk_constraint(self, connection: Connection,
120120
"""Trino has no support for primary keys. Returns a dummy"""
121121
return dict(name=None, constrained_columns=[])
122122

123-
get_primary_keys = get_pk_constraint
123+
def get_primary_keys(self, connection: Connection,
124+
table_name: str, schema: str = None, **kw) -> List[str]:
125+
pk = self.get_pk_constraint(connection, table_name, schema)
126+
return pk.get('constrained_columns')
124127

125128
def get_foreign_keys(self, connection: Connection,
126129
table_name: str, schema: str = None, **kw) -> List[Dict[str, Any]]:

0 commit comments

Comments
 (0)