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

cache serializing error #438

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

bdilday
Copy link
Contributor

@bdilday bdilday commented Jul 4, 2024

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

closes #437

@ss77995ss
Copy link

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: #379

@schorrm schorrm merged commit 691dbe3 into jldbc:master Jul 12, 2024
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache Generates Massive Amounts of Empty Files
3 participants