[incubator-superset] branch update-docker-entry updated (a603baa -> cb03ea9)

2018-07-21 Thread hugh
This is an automated email from the ASF dual-hosted git repository.

hugh pushed a change to branch update-docker-entry
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git.


from a603baa  Update entrypoint
 add cb03ea9  Update docker-entrypoint.sh

No new revisions were added by this update.

Summary of changes:
 contrib/docker/docker-entrypoint.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



[incubator-superset] branch master updated: [sql] Correct SQL parameter formatting (#5178)

2018-07-21 Thread johnbodley
This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
 new 7fcc2af  [sql] Correct SQL parameter formatting (#5178)
7fcc2af is described below

commit 7fcc2af68f79a8a78e1799feb80647ae90ac9370
Author: John Bodley <4567245+john-bod...@users.noreply.github.com>
AuthorDate: Sat Jul 21 12:01:26 2018 -0700

[sql] Correct SQL parameter formatting (#5178)
---
 .pylintrc  |  2 +-
 superset/connectors/sqla/models.py |  9 +--
 superset/db_engine_specs.py| 12 ++-
 .../4451805bbaa1_remove_double_percents.py | 86 ++
 superset/models/core.py| 43 +++
 superset/sql_lab.py|  3 +-
 tests/core_tests.py|  9 +++
 tests/sqllab_tests.py  |  2 +-
 tox.ini|  2 +-
 9 files changed, 138 insertions(+), 30 deletions(-)

diff --git a/.pylintrc b/.pylintrc
index 820637d..016b04e 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -282,7 +282,7 @@ 
ignored-modules=numpy,pandas,alembic.op,sqlalchemy,alembic.context,flask_appbuil
 # List of class names for which member attributes should not be checked (useful
 # for classes with dynamically set attributes). This supports the use of
 # qualified names.
-ignored-classes=optparse.Values,thread._local,_thread._local,sqlalchemy.orm.scoping.scoped_session
+ignored-classes=contextlib.closing,optparse.Values,thread._local,_thread._local,sqlalchemy.orm.scoping.scoped_session
 
 # List of members which are set dynamically and missed by pylint inference
 # system, and so shouldn't trigger E1101 when accessed. Python regular
diff --git a/superset/connectors/sqla/models.py 
b/superset/connectors/sqla/models.py
index 3c5b18e..c86d4ea 100644
--- a/superset/connectors/sqla/models.py
+++ b/superset/connectors/sqla/models.py
@@ -12,7 +12,6 @@ from flask import escape, Markup
 from flask_appbuilder import Model
 from flask_babel import lazy_gettext as _
 import pandas as pd
-import six
 import sqlalchemy as sa
 from sqlalchemy import (
 and_, asc, Boolean, Column, DateTime, desc, ForeignKey, Integer, or_,
@@ -427,14 +426,8 @@ class SqlaTable(Model, BaseDatasource):
 table=self, database=self.database, **kwargs)
 
 def get_query_str(self, query_obj):
-engine = self.database.get_sqla_engine()
 qry = self.get_sqla_query(**query_obj)
-sql = six.text_type(
-qry.compile(
-engine,
-compile_kwargs={'literal_binds': True},
-),
-)
+sql = self.database.compile_sqla_query(qry)
 logging.info(sql)
 sql = sqlparse.format(sql, reindent=True)
 if query_obj['is_prequery']:
diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 97b8095..2b74541 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -65,7 +65,6 @@ class BaseEngineSpec(object):
 """Abstract class for database engine specific configurations"""
 
 engine = 'base'  # str as defined in sqlalchemy.engine.engine
-cursor_execute_kwargs = {}
 time_grains = tuple()
 time_groupby_inline = False
 limit_method = LimitMethod.FORCE_LIMIT
@@ -331,6 +330,10 @@ class BaseEngineSpec(object):
 def normalize_column_name(column_name):
 return column_name
 
+@staticmethod
+def execute(cursor, query, async=False):
+cursor.execute(query)
+
 
 class PostgresBaseEngineSpec(BaseEngineSpec):
 """ Abstract class for Postgres 'like' databases """
@@ -558,7 +561,6 @@ class SqliteEngineSpec(BaseEngineSpec):
 
 class MySQLEngineSpec(BaseEngineSpec):
 engine = 'mysql'
-cursor_execute_kwargs = {'args': {}}
 time_grains = (
 Grain('Time Column', _('Time Column'), '{col}', None),
 Grain('second', _('second'), 'DATE_ADD(DATE({col}), '
@@ -639,7 +641,6 @@ class MySQLEngineSpec(BaseEngineSpec):
 
 class PrestoEngineSpec(BaseEngineSpec):
 engine = 'presto'
-cursor_execute_kwargs = {'parameters': None}
 
 time_grains = (
 Grain('Time Column', _('Time Column'), '{col}', None),
@@ -938,7 +939,6 @@ class HiveEngineSpec(PrestoEngineSpec):
 """Reuses PrestoEngineSpec functionality."""
 
 engine = 'hive'
-cursor_execute_kwargs = {'async': True}
 
 # Scoping regex at class level to avoid recompiling
 # 17/02/07 19:36:38 INFO ql.Driver: Total jobs = 5
@@ -1230,6 +1230,10 @@ class HiveEngineSpec(PrestoEngineSpec):
 configuration['hive.server2.proxy.user'] = username
 return configuration
 
+@staticmethod
+def execute(cursor, query, async=False):
+cursor.execute(query, async=async)
+
 
 class MssqlEngine

[incubator-superset] branch master updated: Clarify title when importing a table (#5454)

2018-07-21 Thread maximebeauchemin
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
 new 6e7b587  Clarify title when importing a table (#5454)
6e7b587 is described below

commit 6e7b5879be405926137f50ebe55794234a19f587
Author: Maxime Beauchemin 
AuthorDate: Sat Jul 21 10:39:41 2018 -0700

Clarify title when importing a table (#5454)

The flow to import a table definition in Superset is confusing, user may
think they are creating a table or what not. This makes the flow a bit
more clear.
---
 superset/connectors/sqla/views.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/superset/connectors/sqla/views.py 
b/superset/connectors/sqla/views.py
index d4149fc..cceee9a 100644
--- a/superset/connectors/sqla/views.py
+++ b/superset/connectors/sqla/views.py
@@ -156,7 +156,7 @@ class TableModelView(DatasourceModelView, DeleteMixin, 
YamlExportMixin):  # noqa
 
 list_title = _('List Tables')
 show_title = _('Show Table')
-add_title = _('Add Table')
+add_title = _('Import a table definition')
 edit_title = _('Edit Table')
 
 list_columns = [



[incubator-superset] branch master updated: Add week granularity for Clickhouse (#5455)

2018-07-21 Thread maximebeauchemin
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
 new 0d5443e  Add week granularity for Clickhouse (#5455)
0d5443e is described below

commit 0d5443e392a0c330a92c4acc740079cc83d0fa44
Author: George 
AuthorDate: Sat Jul 21 19:53:21 2018 +0300

Add week granularity for Clickhouse (#5455)
---
 superset/db_engine_specs.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 669a505..97b8095 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -1350,6 +1350,9 @@ class ClickHouseEngineSpec(BaseEngineSpec):
 Grain('day', _('day'),
   'toStartOfDay(toDateTime({col}))',
   'P1D'),
+Grain('week', _('week'),
+  'toMonday(toDateTime({col}))',
+  'P1W'),
 Grain('month', _('month'),
   'toStartOfMonth(toDateTime({col}))',
   'P1M'),