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

Object of type date is not JSON serializable #651

Closed
adrienpacifico opened this issue Sep 12, 2023 · 1 comment
Closed

Object of type date is not JSON serializable #651

adrienpacifico opened this issue Sep 12, 2023 · 1 comment

Comments

@adrienpacifico
Copy link
Contributor

Object of type date is not JSON serializable
Traceback (most recent call last):
File "/opt/conda/lib/python3.11/site-packages/supervised/base_automl.py", line 1195, in _fit
trained = self.train_model(params)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/supervised/base_automl.py", line 407, in train_model
mf.save(results_path, model_subpath)
File "/opt/conda/lib/python3.11/site-packages/supervised/model_framework.py", line 637, in save
fout.write(json.dumps(desc, indent=4))
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/json/init.py", line 238, in dumps
**kw).encode(obj)
^^^^^^^^^^^
File "/opt/conda/lib/python3.11/json/encoder.py", line 202, in encode
chunks = list(chunks)
^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/json/encoder.py", line 432, in _iterencode
yield from _iterencode_dict(o, _current_indent_level)
File "/opt/conda/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
yield from chunks
File "/opt/conda/lib/python3.11/json/encoder.py", line 326, in _iterencode_list
yield from chunks
File "/opt/conda/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
yield from chunks
File "/opt/conda/lib/python3.11/json/encoder.py", line 326, in _iterencode_list
yield from chunks
File "/opt/conda/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
yield from chunks
File "/opt/conda/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
yield from chunks
File "/opt/conda/lib/python3.11/json/encoder.py", line 439, in _iterencode
o = _default(o)
^^^^^^^^^^^
File "/opt/conda/lib/python3.11/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

pplonski added a commit that referenced this issue Sep 26, 2023
@pplonski
Copy link
Contributor

Ive added custom JSON encoder. It should fix the problem.

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

No branches or pull requests

2 participants