8000 Dataframes have a `to_string` method! · ii0/plotly.py@9bfe62e · GitHub
[go: up one dir, main page]

Skip to content

Commit 9bfe62e

Browse files
committed
Dataframes have a to_string method!
We try to use duck-typing here, but it doesn’t quite make sense.
1 parent 3311acb commit 9bfe62e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plotly/graph_objs/graph_objs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,13 @@ def to_string(self, level=0, indent=4, eol='\n',
700700
eol=eol,
701701
indent=' ' * indent * (level+1),
702702
key=key)
703-
try:
703+
if isinstance(key, PlotlyBase):
704704
string += self[key].to_string(level=level+1,
705705
indent=indent,
706706
eol=eol,
707707
pretty=pretty,
708708
max_chars=max_chars)
709-
except AttributeError:
709+
else:
710710
if pretty: # curtail representation if too many chars
711711
max_len = (max_chars -
712712
indent*(level + 1) -

0 commit comments

Comments
 (0)
0