diff --git a/superset/connectors/druid/views.py b/superset/connectors/druid/views.py index fcd4adbd77ac2..d73331bc5e8c3 100644 --- a/superset/connectors/druid/views.py +++ b/superset/connectors/druid/views.py @@ -185,7 +185,8 @@ def _delete(self, pk): icon='fa-cubes', category='Sources', category_label=__('Sources'), - category_icon='fa-database',) + category_icon='fa-database', +) class DruidDatasourceModelView(DatasourceModelView, DeleteMixin, YamlExportMixin): # noqa @@ -348,4 +349,4 @@ def scan_new_datasources(self): icon='fa-cog') -appbuilder.add_separator('Sources', ) +appbuilder.add_separator('Sources') diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py index 18803c565b76f..e13a8dfd4a0b6 100644 --- a/superset/connectors/sqla/models.py +++ b/superset/connectors/sqla/models.py @@ -349,8 +349,7 @@ def values_for_column(self, column_name, limit=10000): engine = self.database.get_sqla_engine() sql = '{}'.format( - qry.compile( - engine, compile_kwargs={'literal_binds': True}, ), + qry.compile(engine, compile_kwargs={'literal_binds': True}), ) df = pd.read_sql_query(sql=sql, con=engine) diff --git a/superset/connectors/sqla/views.py b/superset/connectors/sqla/views.py index 12f9d6d555617..f4abf12f980c7 100644 --- a/superset/connectors/sqla/views.py +++ b/superset/connectors/sqla/views.py @@ -294,6 +294,7 @@ def refresh(self, tables): label=__('Tables'), category='Sources', category_label=__('Sources'), - icon='fa-table',) + icon='fa-table', +) appbuilder.add_separator('Sources') diff --git a/superset/sql_lab.py b/superset/sql_lab.py index d7b0878011598..63225f3e2d058 100644 --- a/superset/sql_lab.py +++ b/superset/sql_lab.py @@ -240,7 +240,7 @@ def handle_error(msg): limit=query.limit, schema=database.force_ctas_schema, show_cols=False, - latest_partition=False, )) + latest_partition=False)) query.end_time = utils.now_as_float() session.merge(query) session.flush() diff --git a/superset/views/core.py b/superset/views/core.py index 802fda9ef3705..2f0c0e5c2499a 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -187,7 +187,7 @@ class DatabaseView(SupersetModelView, DeleteMixin, YamlExportMixin): # noqa 'allow_ctas', 'allow_dml', 'force_ctas_schema', 'impersonate_user'] search_exclude_columns = ( 'password', 'tables', 'created_by', 'changed_by', 'queries', - 'saved_queries', ) + 'saved_queries') edit_columns = add_columns show_columns = [ 'tables', @@ -281,7 +281,7 @@ def _delete(self, pk): icon='fa-cloud-upload', category='Manage', category_label=__('Manage'), - category_icon='fa-wrench',) + category_icon='fa-wrench') appbuilder.add_view( @@ -291,7 +291,7 @@ def _delete(self, pk): icon='fa-database', category='Sources', category_label=__('Sources'), - category_icon='fa-database',) + category_icon='fa-database') class DatabaseAsync(DatabaseView): @@ -400,7 +400,7 @@ class AccessRequestsModelView(SupersetModelView, DeleteMixin): label=__('Access requests'), category='Security', category_label=__('Security'), - icon='fa-table',) + icon='fa-table') class SliceModelView(SupersetModelView, DeleteMixin): # noqa @@ -488,7 +488,7 @@ def add(self): label=__('Charts'), icon='fa-bar-chart', category='', - category_icon='',) + category_icon='') class SliceAsync(SliceModelView): # noqa @@ -615,7 +615,7 @@ def download_dashboards(self): label=__('Dashboards'), icon='fa-dashboard', category='', - category_icon='',) + category_icon='') class DashboardModelViewAsync(DashboardModelView): # noqa @@ -2594,7 +2594,7 @@ class CssTemplateAsyncModelView(CssTemplateModelView): icon='fa-upload', category='Sources', category_label=__('Sources'), - category_icon='fa-wrench',) + category_icon='fa-wrench') appbuilder.add_separator('Sources') diff --git a/tests/core_tests.py b/tests/core_tests.py index bdc758502fc5a..2d73cf79618df 100644 --- a/tests/core_tests.py +++ b/tests/core_tests.py @@ -833,18 +833,20 @@ def test_import_csv(self): def test_dataframe_timezone(self): tz = psycopg2.tz.FixedOffsetTimezone(offset=60, name=None) - data = [(datetime.datetime(2017, 11, 18, 21, 53, 0, 219225, tzinfo=tz),), - (datetime.datetime(2017, 11, 18, 22, 6, 30, 61810, tzinfo=tz,),)] + data = [ + (datetime.datetime(2017, 11, 18, 21, 53, 0, 219225, tzinfo=tz),), + (datetime.datetime(2017, 11, 18, 22, 6, 30, 61810, tzinfo=tz),), + ] df = dataframe.SupersetDataFrame(pd.DataFrame(data=list(data), - columns=['data', ])) + columns=['data'])) data = df.data self.assertDictEqual( data[0], - {'data': pd.Timestamp('2017-11-18 21:53:00.219225+0100', tz=tz), }, + {'data': pd.Timestamp('2017-11-18 21:53:00.219225+0100', tz=tz)}, ) self.assertDictEqual( data[1], - {'data': pd.Timestamp('2017-11-18 22:06:30.061810+0100', tz=tz), }, + {'data': pd.Timestamp('2017-11-18 22:06:30.061810+0100', tz=tz)}, )