Compare commits

...
Author SHA1 Message Date
Hugh MilesandMaxime Beauchemin 84ee6d5084 Lyft additional endpoints 2018-02-07 12:32:10 -08:00
Maxime Beauchemin 5d4d7febb9 Reverts apache/incubator-superset#4244 (#4303)
(cherry picked from commit f8dcbf70c5)
2018-01-31 08:17:49 -08:00
Hugh Miles cbedb8b814 fixed conflicts 2018-01-29 14:50:55 -08:00
Hugh A. Miles IIandHugh Miles 3fac9367fb Added remaining JS controls to DeckGL layers 2018-01-24 17:13:08 -08:00
Hugh Miles 63cbcb80c3 fastforward to apache/master 2018-01-24 17:05:57 -08:00
Maxime BeaucheminandHugh Miles 36956a5d24 Using a NullPool for external connections by default
Currently, even though `get_sqla_engine` calls get memoized, engines are
still short lived since they are attached to an models.Database ORM
object. All engines created through this method have the scope of a web
request.

Knowing that the SQLAlchemy objects are short lived means that
a related connection pool would also be short lived and mostly useless.
I think it's pretty rare that connections get reused within the context
of a view or Celery worker task.

We've noticed on Redshift that Superset was leaving many connections
opened (hundreds). This is probably due to a combination of the current
process not garbage collecting connections properly, and perhaps the
absence of connection timeout on the redshift side of things. This
could also be related to the fact that we experience web requests timeouts
(enforced by gunicorn) and that process-killing may not allow SQLAlchemy
to clean up connections as they occur (which this PR may not help
fixing...)

For all these reasons, it seems like the right thing to do to use
NullPool for external connection (but not for our connection to the metadata
db!).

Opening the PR for conversation. Putting this query into our staging
today to run some tests.
2018-01-22 16:59:18 -08:00
Hugh A. Miles IIandHugh Miles 1c76d583b3 Added DeckGL.Polygon Layer w/ JS controls (#4227)
* Working polygon layer for deckGL

* add js controls

* add thumbnail

* better description

* refactor to leverage line_column controls

* templates: open code and documentation on a new tab (#4217)

As they are external resources.

* Fix tutorial doesn't match the current interface #4138 (#4215)

* [bugfix] markup and iframe viz raise 'Empty query' (#4225)

closes https://github.com/apache/incubator-superset/issues/4222

Related to: https://github.com/apache/incubator-superset/pull/4016

* [bugfix] time_pivot entry got missing in merge conflict (#4221)

PR here https://github.com/apache/incubator-superset/pull/3518 missed a
line of code while merging conflicts with time_pivot viz

* Improve deck.gl GeoJSON visualization (#4220)

* Improve geoJSON

* Addressing comments

* lint

* refactor to leverage line_column controls

* refactor to use DeckPathViz

* oops
2018-01-18 13:47:04 -08:00
Hugh A. Miles IIandHugh Miles ee77f11b27 remove setting spatial in DeckPathViz class (#4235) 2018-01-18 13:47:04 -08:00
michellethomasandHugh Miles 3b40e90b40 Don't cache if there's no cache key (#4229) 2018-01-18 13:47:04 -08:00
Peter Lubell-DoughtieandHugh Miles 6cd83c3025 add Ona as a user (#4234) 2018-01-18 13:47:03 -08:00
Maxime BeaucheminandHugh Miles af941736a4 Improve deck.gl GeoJSON visualization (#4220)
* Improve geoJSON

* Addressing comments

* lint
2018-01-18 13:47:03 -08:00
Maxime BeaucheminandHugh Miles e502c22c70 [bugfix] time_pivot entry got missing in merge conflict (#4221)
PR here https://github.com/apache/incubator-superset/pull/3518 missed a
line of code while merging conflicts with time_pivot viz
2018-01-18 13:47:03 -08:00
Maxime BeaucheminandHugh Miles 46411bc4ad [bugfix] markup and iframe viz raise 'Empty query' (#4225)
closes https://github.com/apache/incubator-superset/issues/4222

Related to: https://github.com/apache/incubator-superset/pull/4016
2018-01-18 13:47:03 -08:00
Yongjie ZhaoandHugh Miles 32e06616d9 Fix tutorial doesn't match the current interface #4138 (#4215) 2018-01-18 13:47:03 -08:00
Riccardo MagliocchettiandHugh Miles b3bc1429ac templates: open code and documentation on a new tab (#4217)
As they are external resources.
2018-01-18 13:47:03 -08:00
michellethomasandHugh Miles 9b3eef893a Adding limit to time_table viz to get druid query to work (#4207) 2018-01-18 13:47:03 -08:00
Maxime BeaucheminandHugh Miles 151657ba3e [line chart] fix time shift color (#4202) 2018-01-18 13:47:03 -08:00
Hugh Miles 23cc83f300 fix mergeconflicts 2018-01-12 13:45:17 -08:00
Hugh Miles 6e820b8355 rm merge arrows 2018-01-09 16:04:24 -08:00
Hugh Miles 8db14c47e7 fixed permissions 2018-01-09 15:44:00 -08:00
Hugh Miles 58ff72776d updated cherry-pick for lyft-endpoints 2018-01-09 14:12:22 -08:00
Maxime Beauchemin b72bf98f68 Using JS to customize spatial viz and tooltips
(cherry picked from commit df22f29aa49f8e5991e19430aeed816ab08d2dd3)
2018-01-09 09:01:59 -08:00
Hugh MilesandMaxime Beauchemin 32b466184e Moved lyft specific endpoints into its own file
(cherry picked from commit a2630b41c8d7da859a39fe5f9f5e51e66e9e97b9)
2018-01-09 08:57:21 -08:00
Maxime Beauchemin bfdfd66160 Simplify login form for oauth
(cherry picked from commit 89ba06d9a6)
2018-01-09 08:57:10 -08:00
Maxime Beauchemin a4c1d6d5c0 0.23.0rc1 2018-01-09 08:51:11 -08:00
5 changed files with 75 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "superset",
"version": "0.23.0dev",
"version": "0.23.0rc1",
"description": "Superset is a data exploration platform designed to be visual, intuitive, and interactive.",
"license": "Apache-2.0",
"directories": {
@@ -77,6 +77,8 @@ export default function geoJsonLayer(formData, payload, slice) {
features = jsFnMutator(features);
}
features = [];
recurseGeoJson(payload.data, propOverrides, jsFnMutator);
return new GeoJsonLayer({
id: `geojson-layer-${fd.slice_id}`,
filled: fd.filled,
@@ -0,0 +1,15 @@
{% extends "appbuilder/base.html" %}
{% block content %}
<div class="container">
<div id="loginbox" style="margin-top:50px;" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
<center>
<a href="/login/google">
<img width="300" src="https://developers.google.com/accounts/images/sign-in-with-google.png">
</a>
</center>
</div>
</div>
{% endblock %}
+1
View File
@@ -2,3 +2,4 @@ from . import base # noqa
from . import core # noqa
from . import sql_lab # noqa
from . import annotations # noqa
from . import lyft # noqa
+56
View File
@@ -0,0 +1,56 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import logging
import traceback
from flask import (
g, request, Response,
)
from flask_appbuilder import expose
from flask_babel import gettext as __
from superset import (
app, appbuilder, db, utils, sm,
)
import superset.models.core as models
from superset.views.core import Superset
from superset.utils import QueryStatus
from .base import (
json_error_response, generate_download_headers, CsvResponse,
)
config = app.config
stats_logger = config.get('STATS_LOGGER')
log_this = models.Log.log_this
can_access = utils.can_access
DAR = models.DatasourceAccessRequest
ALL_DATASOURCE_ACCESS_ERR = __(
'This endpoint requires the `all_datasource_access` permission')
DATASOURCE_MISSING_ERR = __('The datasource seems to have been deleted')
ACCESS_REQUEST_MISSING_ERR = __(
'The access requests seem to have been deleted')
USER_MISSING_ERR = __('The user seems to have been deleted')
DATASOURCE_ACCESS_ERR = __("You don't have access to this datasource")
def json_success(json_msg, status=200):
return Response(json_msg, status=status, mimetype='application/json')
class Lyft(Superset):
@log_this
@expose('/explore_json/<datasource_type>/<datasource_id>/')
def explore_json(self, datasource_type, datasource_id):
if sm.check_api_access():
return super(Lyft, self).explore_json(datasource_type, datasource_id)
return json_error_response("Access denied")
appbuilder.add_view_no_menu(Lyft)