Closed simonw closed 10 months ago
Here's the bug: https://github.com/simonw/datasette-edit-schema/blob/05a155e8c46cfa6f1fc164370b73cf5f047f4010/datasette_edit_schema/utils.py#L101
Resulted in:
select 'photo's' as label, "photo's" as value from col4),
Another error:
File "/Users/simon/Dropbox/Development/datasette-edit-schema/datasette_edit_schema/utils.py", line 66, in potential_primary_keys
cursor.execute(sql)
sqlite3.OperationalError: near "s": syntax error
That generated SQL like this:
select count(*) as _count,
count(distinct "Document ID") as 'distinct.Document ID',
count(distinct "Agency ID") as 'distinct.Agency ID',
count(distinct "Representative's Address") as 'distinct.Representative's Address'
from "lok-imd8-3w1z"
Trying this against a CSV exported from https://www.regulations.gov/bulkdownload I got an exception visiting
/-/edit-schema/data/tablename
- error was:One of the columns in the table was called
Representative's Address
and I think the'
broke it.The traceback highlighted
examples_for_columns
:https://datasette-cloud.sentry.io/issues/4380834663/?project=2050376&query=is%3Aunresolved&referrer=issue-stream&stream_index=0