hdx-ckan
hdx-ckan copied to clipboard
Change to core CKAN to deal with solr reindexing problem
This ticket was opened in order to keep track of a small change done to core ckan in order to allow for solr reindexing from paster:
I was getting the following error: TypeError: can't compare offset-naive and offset-aware datetimes. Made the following change to fix it ( this change should NOT get into dev branch ): https://github.com/OCHA-DAP/hdx-ckan/commit/225ec519a850f0178c87dd633ed5712c57f88b42
This is caused by one of our additions to package_extras,namely: “last_metadata_update_date”. During the reindexing process ckan check all package extras for fields that end in “_date”. The value of this field is something like “20150121T054147.537Z”. Notice the Z at the end. This make the date parser transform it to a date object that is timezone aware. Then it compares it to a datezone that timezone unaware and throws an exception. Ultimately I think this is a CKAN problem so we might want to do a pull request for them with a fix. Alternatively, we could try to fix it on our side ( renaming the field or changing the format of the value )