Skip to content

Make pandas.NA JSON-serializable - #3649

Closed
GlebMorgan wants to merge 1 commit into
plotly:masterfrom
GlebMorgan:patch-1
Closed

GlebMorgan wants to merge 1 commit into
plotly:masterfrom
GlebMorgan:patch-1

Conversation

@GlebMorgan

Copy link
Copy Markdown

When plotting mapbox from pandas dataframe, if hover_data contains pandas.NA values, it throws Object of type NAType is not JSON serializable error. However for datetime64 objects it handles pandas.NaT values fine. I consider these cases to be similar and propose to make NA objects serializable the same way.

@nicolaskruchten

Copy link
Copy Markdown
Contributor

Thanks for this! Do you know which version of pandas introduced pandas.NA? Should we check for its existence before trying to access it?

@nicolaskruchten

Copy link
Copy Markdown
Contributor

Thanks for the push on this, I've merged #3705 which takes care of this.

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.

2 participants