Skip to content

Commit

Permalink
Removing references to basestring
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Oct 20, 2015
1 parent fc76e87 commit a58d184
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
3 changes: 2 additions & 1 deletion panoramix/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from wtforms import validators
from copy import copy
from panoramix import app
from six import string_types
config = app.config


Expand Down Expand Up @@ -240,7 +241,7 @@ class QueryForm(OmgWtForm):
QueryForm, 'flt_eq_' + str(i),
TextField("Super", default=''))
for ff in viz.form_fields:
if isinstance(ff, basestring):
if isinstance(ff, string_types):
ff = [ff]
for s in ff:
if s:
Expand Down
4 changes: 3 additions & 1 deletion panoramix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import requests
import textwrap

from six import string_types

from panoramix import app, db, get_session, utils
from panoramix.viz import viz_types
from sqlalchemy.ext.declarative import declared_attr
Expand Down Expand Up @@ -766,7 +768,7 @@ def query(
if granularity != "all":
granularity = utils.parse_human_timedelta(
granularity).total_seconds() * 1000
if not isinstance(granularity, basestring):
if not isinstance(granularity, string_types):
granularity = {"type": "duration", "duration": granularity}

qry = dict(
Expand Down
6 changes: 4 additions & 2 deletions panoramix/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from panoramix import app, utils
from panoramix.forms import FormFactory

from six import string_types

config = app.config


Expand Down Expand Up @@ -468,7 +470,7 @@ def to_series(self, df, classed='', title_suffix=''):
if df[name].dtype.kind not in "biufc":
continue
df['timestamp'] = pd.to_datetime(df.index, utc=False)
if isinstance(name, basestring):
if isinstance(name, string_types):
series_title = name
else:
name = ["{}".format(s) for s in name]
Expand Down Expand Up @@ -622,7 +624,7 @@ def get_json_data(self):
if df[name].dtype.kind not in "biufc":
continue
df['timestamp'] = pd.to_datetime(df.index, utc=False)
if isinstance(name, basestring):
if isinstance(name, string_types):
series_title = name
elif len(self.metrics) > 1:
series_title = ", ".join(name)
Expand Down
12 changes: 9 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
alembic>=0.7.7, <0.8.0
flask>=0.10.1, <1.0.0
coverage
coveralls
flask==0.10.1
flask-appbuilder>=1.4.5, <2.0.0
flask-login==0.2.11
flask-migrate>=1.5.1, <2.0.0
flask-script>=2.0.5, <3.0.0
flask-testing>=0.4.2, <0.5.0
gunicorn>=19.3.0, <20.0.0
markdown>=2.6.2, <3.0.0
numpy>=1.10, <2
pandas==0.16.2, <0.17
nose
numpy>=1.9
pandas==0.16.2
parsedatetime>=1.5, <2.0.0
pydruid>=0.2.2, <0.3
python-dateutil>=2.4.2, <3.0.0
requests>=2.7.0, <3.0.0
sqlparse>=0.1.16, <0.2.0
pyhive
pymysql
six
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'flask-testing>=0.4.2, <0.5.0',
'gunicorn>=19.3.0, <20.0.0',
'markdown>=2.6.2, <3.0.0',
'numpy>=1.10, <2',
'numpy>=1.9, <2',
'pandas==0.16.2, <0.17',
'parsedatetime>=1.5, <2.0.0',
'pydruid>=0.2.2, <0.3',
Expand Down

0 comments on commit a58d184

Please sign in to comment.