Skip to content

Commit f1475b9

Browse files
committed
require explicit plotly json encoding by objects
`to_json` was actually used by pandas, and was called by our json encoder before the correct pandas series json encoder was called
1 parent 5d86ef4 commit f1475b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

plotly/grid_objs/grid_objs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __str__(self):
3535
def __repr__(self):
3636
return 'Column("{}", {})'.format(self.data, self.name)
3737

38-
def to_json(self):
38+
def to_plotly_json(self):
3939
return {'name': self.name, 'data': self.data}
4040

4141

plotly/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def sageJSONEncoder(self, obj):
128128

129129
def builtinJSONEncoder(self, obj):
130130
try:
131-
return obj.to_json()
131+
return obj.to_plotly_json()
132132
except AttributeError:
133133
return None
134134

0 commit comments

Comments
 (0)