Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted records still show up #6

Closed
simonw opened this issue Jun 18, 2022 · 3 comments
Closed

Deleted records still show up #6

simonw opened this issue Jun 18, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@simonw
Copy link
Owner

simonw commented Jun 18, 2022

As illustrated by: https://open-data.datasette.io/socrata/resources?_sort=id&domain__isblank=1

image

It looks to me like deleted records stay listed in the database, maybe due to the code that restores their old stored statistics.

@simonw simonw added the bug Something isn't working label Jun 18, 2022
@simonw
Copy link
Owner Author

simonw commented Jun 18, 2022

Relevant code:

for jsonl in files:
if ".stats." in jsonl.name:
db["resources"].upsert_all(_stats(jsonl), pk="id", alter=True)
else:
db["resources"].upsert_all(
_docs(jsonl),
pk="id",
alter=True,
column_order=("id", "domain", "link", "name", "description"),
)

@simonw
Copy link
Owner Author

simonw commented Jun 18, 2022

I'm going to look for link is null and delete those records at the end of the script: https://open-data.datasette.io/socrata/resources?_sort=id&link__isnull=1

@simonw
Copy link
Owner Author

simonw commented Jun 18, 2022

https://open-data.datasette.io/socrata/resources now lists 10,484 records, none of which have a blank link field.

@simonw simonw closed this as completed Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant