Closed simonw closed 4 years ago
Having trouble replicating this locally for some reason. I'll try manually running every step in the GitHub Action.
OK, this has replicated the bug locally:
python -m pip install --upgrade pip
pip install -r requirements.txt
curl -s -H "Authorization: Bearer $DATASETTE_TOKEN" https://biglocal.datasettes.com/-/databases.json | jq '.[].path' -r | while read path; do curl -s -H "Authorization: Bearer $DATASETTE_TOKEN" https://biglocal.datasettes.com/$path -o $path; done;
python fetch_projects.py $BIGLOCAL_TOKEN
Gave me:
Traceback (most recent call last):
File "fetch_projects.py", line 60, in <module>
fetch_projects(db, token)
File "fetch_projects.py", line 53, in fetch_projects
foreign_keys=("project",),
File "/Users/simonw/.local/share/virtualenvs/big-local-datasette-2jT6nJCT/lib/python3.7/site-packages/sqlite_utils/db.py", line 1168, in upsert_all
upsert=True,
File "/Users/simonw/.local/share/virtualenvs/big-local-datasette-2jT6nJCT/lib/python3.7/site-packages/sqlite_utils/db.py", line 1107, in insert_all
row = list(self.rows_where("rowid = ?", [self.last_rowid]))[0]
IndexError: list index out of range
Now I can run python -i fetch_projects.py ...
and then debug with import pdb; pdb.pm()
Could it be that the .upsert_all()
method can't handle compound primary keys?
Oops, that commit message was " Disable cron until I fix #15" which closed this by mistake!
I fixed https://github.com/simonw/sqlite-utils/issues/98 and pushed a release in 2.5 - that should fix the issue here too.
e.g. on https://github.com/simonw/big-local-datasette/runs/578071176?check_suite_focus=true