-
Notifications
You must be signed in to change notification settings - Fork 8
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
DataError: (psycopg2.errors.InvalidTextRepresentation) invalid input syntax for type json (1e9999) #323
Comments
Ah, yes, per our guidance, unlimited maximum lots is expressed as 1e9999, which gets parsed as Infinity. However, SQLAlchemy doesn't know how to serialize Infinity to JSON. Ideally, we would update the SQL adapter. A quick fix would instead replace occurrences of 1e9999 with a very large 32-bit integer, so that PostgreSQL can store it, without changing the meaning of the data. FYI @jakubkrafka as an edge case for the Django version. |
@jpmckinney is that something we can do in the Kingfisher Collect spider? Or do you mean do a manual find and replace and then local load the data? |
It can be done in either Kingfisher Collect or Kingfisher Process. Maybe better in Process, since 1e9999 is allowed in JSON - it's just that Process currently stumbles on it. But in a pinch an analyst can also do the manual find-and-replace. |
Is it worth fixing in Kingfisher Process before the rewrite? The next mini-sprint is scheduled for w/c 9th February, so it may be better to apply the fix in the scraper as we may run several scrapes before then if the publisher is responsive to feedback and it would be good to save analyst time on applying the fix manually. |
Sure, we can have a temporary fix in Kingfisher Collect (cc @yolile), and also open an issue in Kingfisher Collect to remove that fix once this issue is closed in the new version of Kingfisher Process. |
@duncandewhurst I fixed the issue in collect and ran the spider successfully now |
Not a priority as it only affects https://github.com/open-contracting/kingfisher-collect/blob/main/kingfisher_scrapy/spiders/united_kingdom_fts.py#L48 and the data modification doesn’t impact correct data analysis. |
Sentry Issue: KINGFISHER-PROCESS-7X
This happens with the UK spider, eg https://www.find-tender.service.gov.uk/api/1.0/ocdsReleasePackages?limit=100&updatedTo=2021-01-13T16:21:39&cursor=dXBkYXRlZFRvPTIwMjEtMDEtMTNUMTY6MjE6Mzl8bmV4dEN1cnNvcj0xNTAxMzM=
cc @aguilerapy @duncandewhurst
The text was updated successfully, but these errors were encountered: