Skip to content

Commit 7e8f427

Browse files
committed
attempt to fix import errors
1 parent 1733cbf commit 7e8f427

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

plotly/graph_objs/graph_objs.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@
3030
from plotly.graph_objs.graph_objs_tools import (
3131
INFO, OBJ_MAP, NAME_TO_KEY, KEY_TO_NAME
3232
)
33-
from plotly.grid_objs.grid_objs import Column
34-
import copy
33+
3534
from plotly import exceptions
3635
from plotly import utils
36+
37+
import copy
3738
import sys
3839
if sys.version[:3] == '2.6':
3940
from ordereddict import OrderedDict
@@ -302,7 +303,6 @@ def __init__(self, *args, **kwargs):
302303

303304
for key in kwargs:
304305
if utils.is_source_key(key):
305-
#if src in kwargs and isinstance(kwargs[src], Column):
306306
kwargs[key] = self._assign_id_to_src(key, kwargs[key])
307307

308308
super(PlotlyDict, self).__init__(*args, **kwargs)
@@ -341,17 +341,9 @@ def _assign_id_to_src(self, src_name, src_value):
341341
raise exceptions.InputError(err)
342342

343343
if src_id == '':
344-
if isinstance(src_value, Column):
345-
err = exceptions.COLUMN_NOT_YET_UPLOADED_MESSAGE
346-
err.format(column_name=src_value.name, reference=src_name)
347-
raise exceptions.InputError(err)
348-
else:
349-
err = ("{} should be a unique identifier "
350-
"string assigned by the Plotly "
351-
"server to this to this grid column, "
352-
"not an empty string.".format(src_name))
353-
raise exceptions.InputError(err)
354-
344+
err = exceptions.COLUMN_NOT_YET_UPLOADED_MESSAGE
345+
err.format(column_name=src_value.name, reference=src_name)
346+
raise exceptions.InputError(err)
355347
return src_id
356348

357349
def update(self, dict1=None, **dict2):

plotly/grid_objs/grid_objs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
=========
44
55
"""
6+
from __future__ import absolute_import
7+
68

79
import json
810
from collections import MutableSequence
911
from plotly import exceptions
1012
import plotly
1113

14+
__all__ = None
1215

1316
class Column(object):
1417
def __init__(self, data, name):

plotly/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import threading
1313
import re
1414

15-
import grid_objs
15+
import plotly
1616

1717
### incase people are using threading, we lock file reads
1818
lock = threading.Lock()
@@ -129,7 +129,7 @@ def sageJSONEncoder(self, obj):
129129
return None
130130

131131
def ColumnJSONEncoder(self, obj):
132-
if isinstance(obj, grid_objs.Column):
132+
if isinstance(obj, plotly.grid_objs.Column):
133133
return {'name': obj.name, 'data': obj.data}
134134
else:
135135
return None

0 commit comments

Comments
 (0)