Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bqplot/traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ def dataframe_to_json(df, obj):
if df is None:
return None
else:
return df.to_dict(orient='records')
# Replacing NaNs with None as it's not valid JSON
cleandf = df.fillna(np.nan).replace([np.nan], [None])
return cleandf.to_dict(orient='records')


dataframe_serialization = dict(to_json=dataframe_to_json, from_json=dataframe_from_json)
Expand Down
1 change: 0 additions & 1 deletion js/src/Map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ export class Map extends Mark {
} else if (
color_data[d.id] === undefined ||
color_data[d.id] === null ||
color_data[d.id] === 'nan' ||
color_scale === undefined
) {
return colors.default_color;
Expand Down
12 changes: 9 additions & 3 deletions js/src/MarketMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -795,9 +795,15 @@ export class MarketMap extends Figure {
.append('td')
.attr('class', 'tooltiptext')
.text((datum, index) => {
return ref_data === null || ref_data === undefined
? null
: that.tooltip_formats[index](ref_data[datum]);
if (ref_data === null || ref_data === undefined) {
return null;
}

if (ref_data[datum] === null || ref_data[datum] === undefined) {
return 'N/A';
}

return that.tooltip_formats[index](ref_data[datum]);
});
}
this.popper.enableEventListeners();
Expand Down
1 change: 0 additions & 1 deletion test-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
- pandas >=1.0.0,<2.0.0
- bqscales >=0.2.2,<0.3
- scipy
- jupyter
- jupyterlab=3.0.11 # to build the lab federated bundle
- jupyter-packaging # to build the wheel
- pytest
Expand Down