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

df_to_geojson() function should JSON-safe stringify all Pandas datatypes #33

Closed
ryanbaumann opened this issue Jan 6, 2018 · 0 comments

Comments

@ryanbaumann
Copy link
Contributor

ryanbaumann commented Jan 6, 2018

Problem

Passing a datetime Pandas datatype column to df_to_geojson() as a property output throws a JSON serialization error.

See https://github.com/mapbox/mapboxgl-jupyter/blob/master/mapboxgl/utils.py#L28

Solution

Add a data type check and JSON-safe stringification method for all Pandas datatypes datetime64, timedelta[ns], and boolean .

@ryanbaumann ryanbaumann changed the title df_to_geojson() function should stringify all Pandas datatypes df_to_geojson() function should JSON-safe stringify all Pandas datatypes Jan 6, 2018
@ryanbaumann ryanbaumann self-assigned this Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant