-
-
Notifications
You must be signed in to change notification settings - Fork 813
Open
Labels
Description
Label detection doesn't work if the primary key is called pk rather than id, so this page doesn't work: https://latest.datasette.io/fixtures/roadside_attraction_characteristics
Code is here:
Lines 644 to 653 in cccea85
| async def label_column_for_table(self, db_name, table): | |
| explicit_label_column = self.table_metadata(db_name, table).get("label_column") | |
| if explicit_label_column: | |
| return explicit_label_column | |
| # If a table has two columns, one of which is ID, then label_column is the other one | |
| column_names = await self.table_columns(db_name, table) | |
| if column_names and len(column_names) == 2 and "id" in column_names: | |
| return [c for c in column_names if c != "id"][0] | |
| # Couldn't find a label: | |
| return None |
Reactions are currently unavailable