Returns distinct list by col (key)
(self, key)
| 1210 | return output_results |
| 1211 | |
| 1212 | def get_distinct_list(self, key): |
| 1213 | |
| 1214 | """Returns distinct list by col (key)""" |
| 1215 | |
| 1216 | sql_query = f"SELECT DISTINCT {key} FROM {self.library_name};" |
| 1217 | results = self.conn.cursor().execute(sql_query) |
| 1218 | |
| 1219 | output = [] |
| 1220 | for res in results: |
| 1221 | if res: |
| 1222 | if len(res) > 0: |
| 1223 | output.append(res[0]) |
| 1224 | |
| 1225 | self.conn.close() |
| 1226 | |
| 1227 | return output |
| 1228 | |
| 1229 | def filter_by_key_dict (self, key_dict): |
| 1230 |
no test coverage detected