[incubator-superset] branch master updated: fix: make time grain nullable in chart data endpoint (#10187)

2020-06-28 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 26d3472  fix: make time grain nullable in chart data endpoint (#10187)
26d3472 is described below

commit 26d34727d3ceb30a59727819254d45f1c504765e
Author: Ville Brofeldt <33317356+ville...@users.noreply.github.com>
AuthorDate: Mon Jun 29 09:54:01 2020 +0300

fix: make time grain nullable in chart data endpoint (#10187)

* fix: make time grain nullable

* add test

* lint
---
 superset/charts/schemas.py   |  2 ++
 tests/charts/schema_tests.py | 13 -
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/superset/charts/schemas.py b/superset/charts/schemas.py
index 06dc111..3cd2468 100644
--- a/superset/charts/schemas.py
+++ b/superset/charts/schemas.py
@@ -596,10 +596,12 @@ class ChartDataExtrasSchema(Schema):
 ),
 ),
 example="P1D",
+allow_none=True,
 )
 druid_time_origin = fields.String(
 description="Starting point for time grain counting on legacy Druid "
 "datasources. Used to change e.g. Monday/Sunday first-day-of-week.",
+allow_none=True,
 )
 
 
diff --git a/tests/charts/schema_tests.py b/tests/charts/schema_tests.py
index 5f0ef16..fc51d02 100644
--- a/tests/charts/schema_tests.py
+++ b/tests/charts/schema_tests.py
@@ -14,14 +14,15 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+# isort:skip_file
 """Unit tests for Superset"""
 from typing import Any, Dict, Tuple
 
+from tests.test_app import app
 from superset.charts.schemas import ChartDataQueryContextSchema
 from superset.common.query_context import QueryContext
 from tests.base_tests import SupersetTestCase
 from tests.fixtures.query_context import get_query_context
-from tests.test_app import app
 
 
 def load_query_context(payload: Dict[str, Any]) -> Tuple[QueryContext, 
Dict[str, Any]]:
@@ -59,3 +60,13 @@ class SchemaTestCase(SupersetTestCase):
 query_context, errors = ChartDataQueryContextSchema().load(payload)
 self.assertIn("row_limit", errors["queries"][0])
 self.assertIn("row_offset", errors["queries"][0])
+
+def test_query_context_null_timegrain(self):
+self.login(username="admin")
+table_name = "birth_names"
+table = self.get_table_by_name(table_name)
+payload = get_query_context(table.name, table.id, table.type)
+
+payload["queries"][0]["extras"]["time_grain_sqla"] = None
+_, errors = ChartDataQueryContextSchema().load(payload)
+self.assertEqual(errors, {})



[incubator-superset] branch master updated: fix: make auth for hive optional (#10172)

2020-06-28 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 6a8f441  fix: make auth for hive optional (#10172)
6a8f441 is described below

commit 6a8f441d5488c4580a819dc038ff0b02822094e1
Author: Hendrik Schultze <0xbadba...@users.noreply.github.com>
AuthorDate: Mon Jun 29 06:40:24 2020 +0200

fix: make auth for hive optional (#10172)

* fix: make auth for hive optional

This will make allow the admin to setup a root connection which can be 
impersonated.

* style: black lint conform

* style: clean up unnecessary condition expansion
---
 superset/db_engine_specs/hive.py | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/superset/db_engine_specs/hive.py b/superset/db_engine_specs/hive.py
index 952f734..c8a07a9 100644
--- a/superset/db_engine_specs/hive.py
+++ b/superset/db_engine_specs/hive.py
@@ -437,14 +437,9 @@ class HiveEngineSpec(PrestoEngineSpec):
 url = make_url(uri)
 backend_name = url.get_backend_name()
 
-# Must be Hive connection, enable impersonation, and set param
+# Must be Hive connection, enable impersonation, and set optional param
 # auth=LDAP|KERBEROS
-if (
-backend_name == "hive"
-and "auth" in url.query.keys()
-and impersonate_user is True
-and username is not None
-):
+if backend_name == "hive" and impersonate_user and username is not 
None:
 configuration["hive.server2.proxy.user"] = username
 return configuration
 



[incubator-superset] branch master updated (3414f35 -> 9bdfa05)

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

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


from 3414f35  refactor: better naming for config flags (#10180)
 add 9bdfa05  feat(viz): add query mode switch to table chart (#10113)

No new revisions were added by this update.

Summary of changes:
 .../cypress/integration/dashboard/filter.test.js   | 2 +-
 superset-frontend/package-lock.json| 20123 ---
 superset-frontend/package.json |29 +-
 superset-frontend/spec/helpers/shim.js |27 -
 .../javascripts/components/AsyncSelect_spec.jsx|86 +-
 .../components/ListView/ListView_spec.jsx  |12 +-
 .../javascripts/components/TableSelector_spec.jsx  | 4 +-
 .../datasource/ChangeDatasourceModal_spec.jsx  |40 +-
 .../datasource/DatasourceEditor_spec.jsx   |22 +-
 .../datasource/DatasourceModal_spec.jsx|18 +-
 .../explore/components/MetricsControl_spec.jsx |64 +-
 .../explore/components/SaveModal_spec.jsx  |61 +-
 .../spec/javascripts/explore/controlUtils_spec.jsx |15 +-
 .../javascripts/explore/exploreActions_spec.js | 8 +-
 .../messageToasts/components/Toast_spec.jsx|20 +-
 .../javascripts/profile/EditableTitle_spec.jsx | 5 +-
 .../sqllab/ExploreResultsButton_spec.jsx   |   100 +-
 .../spec/javascripts/sqllab/actions/sqlLab_spec.js | 4 +-
 .../javascripts/welcome/DashboardTable_spec.jsx|22 +-
 superset-frontend/src/chart/ChartRenderer.jsx  |16 +-
 .../src/components/ListView/TableCollection.tsx| 4 +-
 .../src/explore/components/Control.jsx |21 +-
 .../explore/components/ControlPanelsContainer.jsx  |   139 +-
 .../src/explore/controlPanels/sections.jsx | 1 +
 superset-frontend/src/explore/controlUtils.js  |95 +-
 .../src/explore/reducers/exploreReducer.js |14 +-
 .../src/types/react-table-config.d.ts  | 2 -
 .../src/views/chartList/ChartList.tsx  |10 +-
 .../src/visualizations/presets/MainPreset.js   | 2 +-
 superset-frontend/src/welcome/DashboardTable.jsx   | 6 +-
 superset-frontend/webpack.config.js| 5 +-
 superset/utils/core.py |20 +
 superset/viz.py|   133 +-
 tests/viz_tests.py |47 +-
 34 files changed, 8746 insertions(+), 12431 deletions(-)