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

Datetime serialization error on ai.load_dataset() #505

Open
kmoppel opened this issue Feb 23, 2025 · 0 comments
Open

Datetime serialization error on ai.load_dataset() #505

kmoppel opened this issue Feb 23, 2025 · 0 comments
Labels
bug Something isn't working community pgai

Comments

@kmoppel
Copy link

kmoppel commented Feb 23, 2025

What happened?

Seems to be dataset specific - most seem to work, but subsets from this one not for some reason: https://huggingface.co/datasets/autogluon/chronos_datasets
Loads ok via Python datasets.load_dataset("autogluon/chronos_datasets", "dominick")

Tried to meddle with "field_types" also but no luck. Happy with any workaround also.

pgai extension affected

0.8.0

pgai library affected

No response

PostgreSQL version used

17.2

What operating system did you use?

timescale/timescaledb-ha:pg17 i.e. 22.04

What installation method did you use?

Docker

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

SELECT ai.load_dataset( 'autogluon/chronos_datasets', 'dominick');
NOTICE:  creating table public.chronos_datasets_dominick
ERROR:  TypeError: Object of type datetime is not JSON serializable
CONTEXT:  Traceback (most recent call last):
  PL/Python function "load_dataset", line 35, in <module>
    return ai.load_dataset.load_dataset(
  PL/Python function "load_dataset", line 253, in load_dataset
  PL/Python function "load_dataset", line 254, in <listcomp>
  PL/Python function "load_dataset", line 230, in dumps
  PL/Python function "load_dataset", line 198, in encode
  PL/Python function "load_dataset", line 256, in iterencode
  PL/Python function "load_dataset", line 178, in default
PL/Python function "load_dataset"

How can we reproduce the bug?

SELECT ai.load_dataset( 'autogluon/chronos_datasets', 'dominick');

Are you going to work on the bugfix?

None

@kmoppel kmoppel added bug Something isn't working community pgai labels Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community pgai
Projects
None yet
Development

No branches or pull requests

1 participant