Closed cbrew closed 4 months ago
Thank you, this is an alarming bug... It seems that our test_factories.journal_citation()
function does not mock citations with a realistic all_editions
field (which should have datetime stuff), so this was not caught in our tests. That seems like a problem in and of itself, but, separately, the utils.hash_sha256()
function does need to handle non-serializable types... Thanks for the PR.
the change is really simple, add default=str to the json.dumps call in utils.hash_sha256().
Making a pull request is harder than I thought, because of lint checks and all that. Working on it slowly.
Easy to fix. The hash function at the end of utils calls json.dumps, which does not handle datetime values.
Pull request coming.
import eyecite small = '25 Texas L.Rev. 199' cit = eyecite.get_citations(small) hash(cit[0])