Skip to content

Commit

Permalink
Merge pull request bqplot#1408 from meeseeksmachine/auto-backport-of-…
Browse files Browse the repository at this point in the history
…pr-1407-on-0.12.x

Backport PR bqplot#1407 on branch 0.12.x (Fix for jupyter_client >= 7)
  • Loading branch information
martinRenou authored Sep 30, 2021
2 parents b6fe965 + 065018e commit baac16f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
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 @@ -791,9 +791,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 @@ -11,7 +11,6 @@ dependencies:
- numpy >=1.10.4,<2.0.0
- pandas >=1.0.0,<2.0.0
- scipy
- jupyter
- jupyterlab=3.0.11 # to build the lab federated bundle
- jupyter-packaging # to build the wheel
- pytest
Expand Down

0 comments on commit baac16f

Please # to comment.