Skip to content

Commit dd20177

Browse files
committed
last of non-blocking
1 parent 495b015 commit dd20177

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

plotly/grid_objs/grid_objs.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,10 @@ def __init__(self, columns_or_json, fid=None):
152152
if fid is None:
153153
raise exceptions.PlotlyError(
154154
"If you are manually converting a raw json/dict grid "
155-
"into a Grid instance, you must ensure that make "
156-
"'fid' is set to your file ID. This looks like "
157-
"'username:187'."
155+
"into a Grid instance, you must ensure that 'fid' is "
156+
"set to your file ID. This looks like 'username:187'."
158157
)
159-
# TODO: verify that fid is a correct fid if a string
158+
160159
self.id = fid
161160

162161
# check if 'cols' is a root key
@@ -195,7 +194,7 @@ def __init__(self, columns_or_json, fid=None):
195194
)
196195
self._columns = ordered_columns
197196

198-
# fill in uids
197+
# fill in column_ids
199198
for column in self:
200199
column.id = self.id + ':' + columns_or_json['cols'][column.name]['uid']
201200

@@ -262,19 +261,18 @@ def get_column_reference(self, column_name):
262261
Raises an error if the column name is not in the grid. Otherwise,
263262
returns the fid:uid pair, which may be the empty string.
264263
"""
265-
col_names = []
266-
for column in self._columns:
267-
col_names.append(column.name)
268-
269264
column_id = None
270265
for column in self._columns:
271266
if column.name == column_name:
272267
column_id = column.id
273268
break
274269

275270
if column_id is None:
271+
col_names = []
272+
for column in self._columns:
273+
col_names.append(column.name)
276274
raise exceptions.PlotlyError(
277275
"Whoops, that column name doesn't match any of the column "
278-
"names in your grid. You must pick from {cols}".format(col_names)
276+
"names in your grid. You must pick from {cols}".format(cols=col_names)
279277
)
280278
return column_id

plotly/plotly/plotly.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,7 @@ def create_animations(figure, filename=None, sharing='public', auto_open=True):
15941594
parsed_response = r.content
15951595

15961596
if 'error' in r and r['error'] != '':
1597-
raise exceptions.PlotlyError(r['message'])
1597+
raise exceptions.PlotlyError(r['error'])
15981598

15991599
if sharing == 'secret':
16001600
web_url = (parsed_response['file']['web_url'][:-1] +
@@ -1615,7 +1615,7 @@ def icreate_animations(figure, filename=None, sharing='public', auto_open=False)
16151615
This function is based off `plotly.plotly.iplot`. See `plotly.plotly.
16161616
create_animations` Doc String for param descriptions.
16171617
"""
1618-
# TODO - create a wrapper for iplot and icreate_animations
1618+
# Still needs doing: create a wrapper for iplot and icreate_animations
16191619
url = create_animations(figure, filename, sharing, auto_open)
16201620

16211621
if isinstance(figure, dict):

0 commit comments

Comments
 (0)