@@ -92,6 +92,10 @@ def get_columns(self, connection: Connection,
92
92
table_name : str , schema : str = None , ** kw ) -> List [Dict [str , Any ]]:
93
93
if not self .has_table (connection , table_name , schema ):
94
94
raise exc .NoSuchTableError (f"schema={ schema } , table={ table_name } " )
95
+ return self ._get_columns (connection , table_name , schema , ** kw )
96
+
97
+ def _get_columns (self , connection : Connection ,
98
+ table_name : str , schema : str = None , ** kw ) -> List [Dict [str , Any ]]:
95
99
schema = schema or self ._get_default_schema_name (connection )
96
100
query = dedent ("""
97
101
SELECT
@@ -179,7 +183,16 @@ def get_view_definition(self, connection: Connection, view_name: str, schema: st
179
183
180
184
def get_indexes (self , connection : Connection ,
181
185
table_name : str , schema : str = None , ** kw ) -> List [Dict [str , Any ]]:
182
- pass
186
+ if not self .has_table (connection , table_name , schema ):
187
+ raise exc .NoSuchTableError (f"schema={ schema } , table={ table_name } " )
188
+
189
+ partitioned_columns = self ._get_columns (connection , f"{ table_name } $partitions" , schema , ** kw )
190
+ partition_index = dict (
191
+ name = "partition" ,
192
+ column_names = [col ['name' ] for col in partitioned_columns ],
193
+ unique = False
194
+ )
195
+ return [partition_index , ]
183
196
184
197
def get_unique_constraints (self , connection : Connection ,
185
198
table_name : str , schema : str = None , ** kw ) -> List [Dict [str , Any ]]:
0 commit comments