[incubator-superset] branch master updated: chore: bump superset-ui to 0.13.27 (#10018)

2020-06-10 Thread villebro
This is an automated email from the ASF dual-hosted git repository.

villebro 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 a8db78b  chore: bump superset-ui to 0.13.27 (#10018)
a8db78b is described below

commit a8db78b069800017cf397e47a0f41d25c8d3ea8d
Author: Ville Brofeldt <33317356+ville...@users.noreply.github.com>
AuthorDate: Wed Jun 10 10:13:00 2020 +0300

chore: bump superset-ui to 0.13.27 (#10018)

* chore: bump superset-ui

* Remove redundant control panels
---
 superset-frontend/package-lock.json| 469 +
 superset-frontend/package.json |  78 ++--
 superset-frontend/src/chart/chartAction.js |  10 +-
 .../src/explore/controlPanels/CountryMap.js| 106 -
 .../src/explore/controlPanels/EventFlow.jsx| 128 --
 superset-frontend/src/setup/setupPlugins.ts|   4 -
 6 files changed, 337 insertions(+), 458 deletions(-)

diff --git a/superset-frontend/package-lock.json 
b/superset-frontend/package-lock.json
index 9376e08..68aad1d 100644
--- a/superset-frontend/package-lock.json
+++ b/superset-frontend/package-lock.json
@@ -3626,18 +3626,23 @@
   }
 },
 "@babel/polyfill": {
-  "version": "7.4.4",
-  "resolved": 
"https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.4.4.tgz";,
-  "integrity": 
"sha512-WlthFLfhQQhh+A2Gn5NSFl0Huxz36x86Jn+E9OW7ibK8edKPq+KLy4apM1yDpQ8kJOVi1OVjpP4vSDLdrI04dg==",
+  "version": "7.10.1",
+  "resolved": 
"https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.10.1.tgz";,
+  "integrity": 
"sha512-TviueJ4PBW5p48ra8IMtLXVkDucrlOZAIZ+EXqS3Ot4eukHbWiqcn7DcqpA1k5PcKtmJ4Xl9xwdv6yQvvcA+3g==",
   "requires": {
 "core-js": "^2.6.5",
-"regenerator-runtime": "^0.13.2"
+"regenerator-runtime": "^0.13.4"
   },
   "dependencies": {
 "core-js": {
-  "version": "2.6.9",
-  "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz";,
-  "integrity": 
"sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A=="
+  "version": "2.6.11",
+  "resolved": 
"https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz";,
+  "integrity": 
"sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg=="
+},
+"regenerator-runtime": {
+  "version": "0.13.5",
+  "resolved": 
"https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz";,
+  "integrity": 
"sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
 }
   }
 },
@@ -5475,9 +5480,9 @@
   },
   "dependencies": {
 "@babel/runtime": {
-  "version": "7.9.6",
-  "resolved": 
"https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz";,
-  "integrity": 
"sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==",
+  "version": "7.10.2",
+  "resolved": 
"https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.2.tgz";,
+  "integrity": 
"sha512-6sF3uQw2ivImfVIl62RZ7MXhO2tap69WeWK57vAaimT6AZbE4FbqjdEJIN1UqoD6wI6B+1n9UiagafH1sxjOtg==",
   "requires": {
 "regenerator-runtime": "^0.13.4"
   }
@@ -6512,32 +6517,23 @@
   "dev": true
 },
 "@superset-ui/chart": {
-  "version": "0.13.7",
-  "resolved": 
"https://registry.npmjs.org/@superset-ui/chart/-/chart-0.13.7.tgz";,
-  "integrity": 
"sha512-mex++Z67nl809ZkgK44rW0DsIp7W73tGlXtTRfyVVjHDJMG4VYZ4BSrxMfunj4STgqW9IZWjGDe+ZAPXNyBkjA==",
+  "version": "0.13.27",
+  "resolved": 
"https://registry.npmjs.org/@superset-ui/chart/-/chart-0.13.27.tgz";,
+  "integrity": 
"sha512-diCSG5s+611LSPtA8lsEeAUUtzCS8uR/+9JR/lIdtSmPvhlzC1wtw5ULaZZzZbXsjsqD9NElQZNKJByRxp+OQw==",
   "requires": {
 "@types/react": "^16.9.34",
 "@types/react-loadable": "^5.4.2",
-"@vx/responsive": "^0.0.196",
+"@vx/responsive": "^0.0.197",
 "prop-types": "^15.6.2",
 "react-error-boundary": "^1.2.5",
 "react-loadable": "^5.5.0",
 "reselect": "^4.0.0"
   },
   "dependencies": {
-"@types/react": {
-  "version": "16.9.34",
-  "resolved": 
"https://registry.npmjs.org/@types/react/-/react-16.9.34.tgz";,
-  "integrity": 
"sha512-8AJlYMOfPe1KGLKyHpflCg5z46n0b5DbRfqDksxBLBTUpB75ypDBAO9eCUcjNwE6LCUslwTz00yyG/X9gaVtow==",
-  "requires": {
-"@types/prop-types": "*",
-"csstype": "^2.2.0"
-  }
-},
 "@vx/responsive": {
-  "version": "0.0.196",
-  "resolved": 
"https://registry.npmjs.org/@vx/responsive/-/responsive-0.0.196.tgz";,
-  "integrity": 
"sha512-mwV0pf7Yj

[incubator-superset] branch master updated: fix: raise error in sqllab when using reserved column name (#9859)

2020-06-10 Thread villebro
This is an automated email from the ASF dual-hosted git repository.

villebro 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 56397d7  fix: raise error in sqllab when using reserved column name 
(#9859)
56397d7 is described below

commit 56397d75cc6192eeed7ed4d353629f8144de3df5
Author: Ville Brofeldt <33317356+ville...@users.noreply.github.com>
AuthorDate: Wed Jun 10 16:32:43 2020 +0300

fix: raise error in sqllab when using reserved column name (#9859)
---
 .../spec/javascripts/sqllab/ExploreResultsButton_spec.jsx |  1 +
 superset-frontend/spec/javascripts/sqllab/fixtures.js | 10 ++
 .../src/SqlLab/components/ExploreResultsButton.jsx| 11 ++-
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git 
a/superset-frontend/spec/javascripts/sqllab/ExploreResultsButton_spec.jsx 
b/superset-frontend/spec/javascripts/sqllab/ExploreResultsButton_spec.jsx
index ad6639b..f2e66b8 100644
--- a/superset-frontend/spec/javascripts/sqllab/ExploreResultsButton_spec.jsx
+++ b/superset-frontend/spec/javascripts/sqllab/ExploreResultsButton_spec.jsx
@@ -101,6 +101,7 @@ describe('ExploreResultsButton', () => {
   '1',
   '123',
   'CASE WHEN 1=1 THEN 1 ELSE 0 END',
+  '__TIMESTAMP',
 ]);
 
 const msgWrapper = 
shallow(wrapper.instance().renderInvalidColumnMessage());
diff --git a/superset-frontend/spec/javascripts/sqllab/fixtures.js 
b/superset-frontend/spec/javascripts/sqllab/fixtures.js
index 98bd202..a88f938 100644
--- a/superset-frontend/spec/javascripts/sqllab/fixtures.js
+++ b/superset-frontend/spec/javascripts/sqllab/fixtures.js
@@ -315,6 +315,16 @@ export const queryWithBadColumns = {
 name: 'CASE WHEN 1=1 THEN 1 ELSE 0 END',
 type: 'STRING',
   },
+  {
+is_date: true,
+name: '_TIMESTAMP',
+type: 'TIMESTAMP',
+  },
+  {
+is_date: true,
+name: '__TIMESTAMP',
+type: 'TIMESTAMP',
+  },
 ],
   },
 };
diff --git a/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx 
b/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx
index 37a46b3..2bdcdb0 100644
--- a/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx
+++ b/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx
@@ -104,10 +104,11 @@ class ExploreResultsButton extends React.PureComponent {
   getInvalidColumns() {
 const re1 = /^[A-Za-z_]\w*$/; // starts with char or _, then only alphanum
 const re2 = /__\d+$/; // does not finish with __ and then a number which 
screams dup col name
+const re3 = /^__/; // is not a reserved column name e.g. __timestamp
 
 return this.props.query.results.selected_columns
   .map(col => col.name)
-  .filter(col => !re1.test(col) || re2.test(col));
+  .filter(col => !re1.test(col) || re2.test(col) || re3.test(col));
   }
   datasourceName() {
 const { query } = this.props;
@@ -194,13 +195,13 @@ class ExploreResultsButton extends React.PureComponent {
 
 {t('cannot be used as a column name. Please use aliases (as in ')}
 
-  SELECT count(*)
+  SELECT count(*) 
   AS my_alias
 
 ){' '}
-{t(`limited to alphanumeric characters and underscores. Column aliases 
ending with
-  double underscores followed by a numeric value are not allowed for 
reasons
-  discussed in Github issue #5739.
+{t(`limited to alphanumeric characters and underscores. Column aliases 
starting
+  with double underscores or ending with double underscores followed 
by a
+  numeric value are not allowed for reasons discussed in Github issue 
#5739.
   `)}
   
 );



[incubator-superset] branch master updated (56397d7 -> e17da58)

2020-06-10 Thread erikrit
This is an automated email from the ASF dual-hosted git repository.

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


from 56397d7  fix: raise error in sqllab when using reserved column name 
(#9859)
 add e17da58  feat: add replace option to hive csv upload (#9764)

No new revisions were added by this update.

Summary of changes:
 superset/db_engine_specs/hive.py| 21 -
 tests/db_engine_specs/hive_tests.py | 13 +
 2 files changed, 33 insertions(+), 1 deletion(-)



[incubator-superset] branch master updated: feat: Add owners and physical/virtual status to Datasets API list endpoint (#10025)

2020-06-10 Thread villebro
This is an automated email from the ASF dual-hosted git repository.

villebro 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 4ef2699  feat: Add owners and physical/virtual status to Datasets API 
list endpoint (#10025)
4ef2699 is described below

commit 4ef26993e2f88d69a2f4e632c570e1e555e2e2ef
Author: Will Barrett 
AuthorDate: Wed Jun 10 12:04:40 2020 -0700

feat: Add owners and physical/virtual status to Datasets API list endpoint 
(#10025)

* Add owners and physical/virtual status to Datasets API list endpoint

* black

* Update type definition for DatasourceKind

Co-authored-by: Ville Brofeldt <33317356+ville...@users.noreply.github.com>

* Fixin' tests and mypy

Co-authored-by: Ville Brofeldt <33317356+ville...@users.noreply.github.com>
---
 .gitignore |  1 +
 superset/connectors/base/models.py | 13 +
 superset/datasets/api.py   |  5 +
 tests/datasets/api_tests.py|  3 +++
 4 files changed, 22 insertions(+)

diff --git a/.gitignore b/.gitignore
index 0ccddfa..77e5aad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,6 +23,7 @@
 .bento*
 .cache-loader
 .coverage
+cover
 .DS_Store
 .eggs
 .envrc
diff --git a/superset/connectors/base/models.py 
b/superset/connectors/base/models.py
index fb2d5eb..eb0d3e2 100644
--- a/superset/connectors/base/models.py
+++ b/superset/connectors/base/models.py
@@ -15,6 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 import json
+from enum import Enum
 from typing import Any, Dict, Hashable, List, Optional, Type, Union
 
 from flask_appbuilder.security.sqla.models import User
@@ -51,6 +52,11 @@ COLUMN_FORM_DATA_PARAMS = [
 ]
 
 
+class DatasourceKind(str, Enum):
+VIRTUAL = "virtual"
+PHYSICAL = "physical"
+
+
 class BaseDatasource(
 AuditMixinNullable, ImportMixin
 ):  # pylint: disable=too-many-public-methods
@@ -101,6 +107,13 @@ class BaseDatasource(
 owners: List[User]
 update_from_object_fields: List[str]
 
+@property
+def kind(self) -> str:
+if self.sql:
+return DatasourceKind.VIRTUAL.value
+
+return DatasourceKind.PHYSICAL.value
+
 @declared_attr
 def slices(self) -> RelationshipProperty:
 return relationship(
diff --git a/superset/datasets/api.py b/superset/datasets/api.py
index 7452b66..bafcebf 100644
--- a/superset/datasets/api.py
+++ b/superset/datasets/api.py
@@ -78,6 +78,11 @@ class DatasetRestApi(BaseSupersetModelRestApi):
 "changed_on",
 "default_endpoint",
 "explore_url",
+"kind",
+"owners.id",
+"owners.username",
+"owners.first_name",
+"owners.last_name",
 "schema",
 "table_name",
 ]
diff --git a/tests/datasets/api_tests.py b/tests/datasets/api_tests.py
index 47d98e6..75e9aea 100644
--- a/tests/datasets/api_tests.py
+++ b/tests/datasets/api_tests.py
@@ -23,6 +23,7 @@ import prison
 import yaml
 from sqlalchemy.sql import func
 
+import tests.test_app
 from superset.connectors.sqla.models import SqlaTable, SqlMetric, TableColumn
 from superset.dao.exceptions import (
 DAOCreateFailedError,
@@ -96,6 +97,8 @@ class DatasetApiTests(SupersetTestCase):
 "default_endpoint",
 "explore_url",
 "id",
+"kind",
+"owners",
 "schema",
 "table_name",
 ]



[incubator-superset] branch master updated: fix: bump pydruid to 0.6.0 (#10014)

2020-06-10 Thread erikrit
This is an automated email from the ASF dual-hosted git repository.

erikrit 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 1a6b9d7  fix: bump pydruid to 0.6.0 (#10014)
1a6b9d7 is described below

commit 1a6b9d74569a731176185a8317cee5d4b7ec9a3a
Author: Karen Palacio 
AuthorDate: Wed Jun 10 16:40:51 2020 -0300

fix: bump pydruid to 0.6.0 (#10014)

* bump pydruid to 0.5.11

* bump pydruid to 0.6.0
---
 requirements-dev.txt | 2 +-
 setup.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/requirements-dev.txt b/requirements-dev.txt
index 58f9591..a223689 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -26,7 +26,7 @@ pip-tools==5.1.2
 pre-commit==1.17.0
 psycopg2-binary==2.8.5
 pycodestyle==2.5.0
-pydruid==0.5.9
+pydruid==0.6.0
 pyhive==0.6.2
 pylint==1.9.2
 redis==3.5.1
diff --git a/setup.py b/setup.py
index ed8176c..6b133e6 100644
--- a/setup.py
+++ b/setup.py
@@ -119,7 +119,7 @@ setup(
 "postgres": ["psycopg2-binary==2.8.5"],
 "presto": ["pyhive[presto]>=0.4.0"],
 "elasticsearch": ["elasticsearch-dbapi>=0.1.0, <0.2.0"],
-"druid": ["pydruid==0.5.7", "requests==2.22.0"],
+"druid": ["pydruid==0.6.0", "requests==2.22.0"],
 "hana": ["hdbcli==2.4.162", "sqlalchemy_hana==0.4.0"],
 "dremio": ["sqlalchemy_dremio>=1.1.0"],
 "cockroachdb": ["cockroachdb==0.3.3"],



[incubator-superset] branch master updated: fix: Resolves a regression from #9939 (#10033)

2020-06-10 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 36627af  fix: Resolves a regression from #9939 (#10033)
36627af is described below

commit 36627af916c1001f0f156a9bd4fc6d7480006c55
Author: John Bodley <4567245+john-bod...@users.noreply.github.com>
AuthorDate: Wed Jun 10 13:42:08 2020 -0700

fix: Resolves a regression from #9939 (#10033)

Co-authored-by: John Bodley 
---
 superset/views/core.py | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/superset/views/core.py b/superset/views/core.py
index 44cade9..6df7d34 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -917,9 +917,6 @@ class Superset(BaseSupersetView):
 )
 
 if action in ("saveas", "overwrite"):
-if not slc:
-return json_error_response("The slice does not exist")
-
 return self.save_or_overwrite_slice(
 slc,
 slice_add_perm,
@@ -1003,7 +1000,7 @@ class Superset(BaseSupersetView):
 
 def save_or_overwrite_slice(
 self,
-slc: Slice,
+slc: Optional[Slice],
 slice_add_perm: bool,
 slice_overwrite_perm: bool,
 slice_download_perm: bool,
@@ -1025,6 +1022,7 @@ class Superset(BaseSupersetView):
 form_data.get("adhoc_filters", [])
 )
 
+assert slc
 slc.params = json.dumps(form_data, indent=2, sort_keys=True)
 slc.datasource_name = datasource_name
 slc.viz_type = form_data["viz_type"]



[incubator-superset] branch master updated (36627af -> d1588c7)

2020-06-10 Thread maximebeauchemin
This is an automated email from the ASF dual-hosted git repository.

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


from 36627af  fix: Resolves a regression from #9939 (#10033)
 add d1588c7  Fix chart annotation source type showing perpetual loading 
when re-selecting the same value. (#10036)

No new revisions were added by this update.

Summary of changes:
 .../src/explore/components/controls/AnnotationLayer.jsx  | 16 ++--
 .../src/explore/components/controls/SelectControl.jsx|  2 ++
 2 files changed, 12 insertions(+), 6 deletions(-)



[incubator-superset] branch master updated: [csv upload][hive] support other delimiters (#9971)

2020-06-10 Thread bkyryliuk
This is an automated email from the ASF dual-hosted git repository.

bkyryliuk 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 8744dad  [csv upload][hive] support other delimiters (#9971)
8744dad is described below

commit 8744dadca8f98a84c7cbdbd098e53e435627063d
Author: serenajiang 
AuthorDate: Wed Jun 10 17:08:02 2020 -0700

[csv upload][hive] support other delimiters (#9971)

Co-authored-by: serena-jiang 
---
 superset/db_engine_specs/hive.py | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/superset/db_engine_specs/hive.py b/superset/db_engine_specs/hive.py
index afa1103..f99b180 100644
--- a/superset/db_engine_specs/hive.py
+++ b/superset/db_engine_specs/hive.py
@@ -24,7 +24,7 @@ from urllib import parse
 
 import pandas as pd
 from flask import g
-from sqlalchemy import Column
+from sqlalchemy import Column, text
 from sqlalchemy.engine.base import Engine
 from sqlalchemy.engine.reflection import Inspector
 from sqlalchemy.engine.url import make_url, URL
@@ -182,13 +182,18 @@ class HiveEngineSpec(PrestoEngineSpec):
 bucket_path,
 os.path.join(upload_prefix, table.table, 
os.path.basename(filename)),
 )
-
-# TODO(bkyryliuk): support other delimiters
-sql = f"""CREATE TABLE {str(table)} ( {schema_definition} )
-ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS
-TEXTFILE LOCATION '{location}'
+sql = text(
+f"""CREATE TABLE {str(table)} ( {schema_definition} )
+ROW FORMAT DELIMITED FIELDS TERMINATED BY :delim
+STORED AS TEXTFILE LOCATION :location
 tblproperties ('skip.header.line.count'='1')"""
-engine.execute(sql)
+)
+engine = cls.get_engine(database)
+engine.execute(
+sql,
+delim=csv_to_df_kwargs["sep"].encode().decode("unicode_escape"),
+location=location,
+)
 
 @classmethod
 def convert_dttm(cls, target_type: str, dttm: datetime) -> Optional[str]: