The cache writer has been writing corrupted files. The reason seems to be that statcast takes dates as args and these can't be json serialized, example,
>>> import json
>>> import datetime
>>> json.dumps(datetime.date.today())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.12/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/json/encoder.py", line 200, in encode
chunks = self.iterencode(o, _one_shot=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/json/encoder.py", line 258, in iterencode
return _iterencode(o, 0)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/json/encoder.py", line 180, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type date is not JSON serializable
Hi @bdilday . It looks like this PR could also fix this issue! Could you also test this case, too?
If so I am going to close my PR
ref: https://github.com/jldbc/pybaseball/pull/379
The cache writer has been writing corrupted files. The reason seems to be that statcast takes dates as args and these can't be json serialized, example,
closes https://github.com/jldbc/pybaseball/issues/437