File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
* Fixed a bug with multiple altair outputs not working inside a ` @shiny.render.ui ` decorator. (#140 )
11
11
* ` @render_widget ` no longer errors out when giving a ` altair.FacetChart ` class. (#142 )
12
+ * ` @render_widget ` no longer fails to serialize ` decimal.Decimal ` objects. (#138 )
12
13
13
14
## [ 0.3.1] - 2024-03-01
14
15
Original file line number Diff line number Diff line change
1
+ import decimal
1
2
import json
2
3
import numbers
3
4
import warnings
@@ -44,6 +45,9 @@ def json_default(obj: object) -> object:
44
45
if isinstance (obj , numbers .Real ):
45
46
return float (obj )
46
47
48
+ if isinstance (obj , decimal .Decimal ):
49
+ return float (obj )
50
+
47
51
raise TypeError ("%r is not JSON serializable" % obj )
48
52
49
53
You can’t perform that action at this time.
0 commit comments