From 4fbaff9a42d262489dbd6e02052cd267e42cd0b3 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 18 Jan 2019 20:47:37 +0100 Subject: [PATCH 1/3] pep8/python3 (#29914) --- bijoe/schemas.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bijoe/schemas.py b/bijoe/schemas.py index 80bbc67..5cc5ee2 100644 --- a/bijoe/schemas.py +++ b/bijoe/schemas.py @@ -16,6 +16,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import six + import datetime import decimal import collections @@ -81,7 +83,7 @@ class Base(object): for key in slots: assert key in d or hasattr(cls, key), \ '%s.%s is is a mandatory attribute' % (cls.__name__, key) - if not key in d: + if key not in d: continue value = d[key] if key in types: @@ -126,7 +128,7 @@ class Measure(Base): __slots__ = ['name', 'label', 'type', 'expression'] __types__ = { 'name': str, - 'label': unicode, + 'label': six.text_type, 'type': type_cast, 'expression': str, } @@ -138,7 +140,7 @@ class Dimension(Base): 'filter_needs_join', 'filter_expression'] __types__ = { 'name': str, - 'label': unicode, + 'label': six.text_type, 'type': str, 'join': [str], 'value': str, @@ -193,9 +195,9 @@ class Dimension(Base): value='TO_CHAR(EXTRACT(month from %s), \'00\') || \'/\' || EXTRACT(year from %s)' % (self.value, self.value), group_by='EXTRACT(year from %s), EXTRACT(month from %s)' % (self.value, - self.value), + self.value), order_by=['EXTRACT(year from %s), EXTRACT(month from %s)' % (self.value, - self.value)], + self.value)], filter=False), Dimension( label=u'mois (%s)' % self.label, @@ -316,7 +318,7 @@ class Cube(Base): 'measures'] __types__ = { 'name': str, - 'label': unicode, + 'label': six.text_type, 'fact_table': str, 'json_field': str, 'key': str, @@ -370,11 +372,10 @@ class Warehouse(Base): __slots__ = ['name', 'label', 'pg_dsn', 'search_path', 'cubes'] __types__ = { 'name': str, - 'label': unicode, + 'label': six.text_type, 'pg_dsn': str, 'search_path': [str], 'cubes': [Cube], - 'search_path': [str], } def check(self): -- 2.20.1