[Bug][Jupyter Widget] Default widget serialization fails for pandas datetime.time cells

Open
#4,656 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
56/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
jupyter, pandas, python, typescript

Research direction

Start by tracing how the Python widget serializes pandas DataFrame values into get_state()['data'], then inspect the repository's widget serialization tests and the default serializer path. Reproduce the issue with the provided datetime.time example and confirm Jupyter packing succeeds with use_arrow=True. Done when default serialization handles the value clearly and the regression is covered by a test.

Written by the indexing model from the issue text.

Description

python

Reproduction

import datetime
import pandas as pd
from jupyter_client.session import json_packer
from keplergl import KeplerGl

df = pd.DataFrame({'lat': [37.8], 'time': [datetime.time(12, 34, 56)]})
widget = KeplerGl(data={'d': df})
json_packer(widget.get_state()['data'])

Observed: ValueError: Can't clean for JSON: datetime.time(12, 34, 56). Expected: the widget's default serialization should support this ordinary temporal value or handle it clearly. With KeplerGl(data={'d': df}, use_arrow=True), Jupyter packing succeeds for this example. This is separate from closed #4621 concerning Arrow time/duration scaling.

Environment and scope

Tested on master 8d145c6da791f096503cf6bd8a1c6c6ef7892861, Python package 0.5.0rc1, Python 3.12.5, pandas 3.0.1, geopandas 1.1.2, pyarrow 25.0.1, anywidget 0.9.21, and Node 24.21.0. The observations below come from Python widget/serializer probes and, where noted, the repository's JavaScript data or layer loader; they were not checked in a live notebook or browser.

Dominant language
TypeScript
Stars
12.1k
Forks
2k
Avg merge
5h 54m
Merged PRs (30d)
528

Getting set up

  • No Dockerfile or Docker Compose file
  • No pull request template
  • Read the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from keplergl/kepler.gl

All issues in keplergl/kepler.gl

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.