Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Nov 12, 2020
1 parent 7016c48 commit 858289f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
27 changes: 6 additions & 21 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ def approve(self) -> FlaskResponse: # pylint: disable=too-many-locals,no-self-u
def clean_fulfilled_requests(session: Session) -> None:
for dar in session.query(DAR).all():
datasource = ConnectorRegistry.get_datasource(
dar.datasource_type,
dar.datasource_id,
session,
dar.datasource_type, dar.datasource_id, session,
)
if not datasource or security_manager.can_access_datasource(datasource):
# datasource does not exist anymore
Expand Down Expand Up @@ -751,9 +749,7 @@ def filter( # pylint: disable=no-self-use
"""
# TODO: Cache endpoint by user, datasource and column
datasource = ConnectorRegistry.get_datasource(
datasource_type,
datasource_id,
db.session,
datasource_type, datasource_id, db.session,
)
if not datasource:
return json_error_response(DATASOURCE_MISSING_ERR)
Expand Down Expand Up @@ -1096,12 +1092,7 @@ def save_dash( # pylint: disable=no-self-use
last_modified_time = dash.changed_on.replace(microsecond=0).timestamp()
session.close()
return json_success(
json.dumps(
{
"status": "SUCCESS",
"last_modified_time": last_modified_time,
}
)
json.dumps({"status": "SUCCESS", "last_modified_time": last_modified_time,})
)

@api
Expand Down Expand Up @@ -1217,8 +1208,7 @@ def recent_activity( # pylint: disable=no-self-use

has_subject_title = or_(
and_(
Dashboard.dashboard_title is not None,
Dashboard.dashboard_title != "",
Dashboard.dashboard_title is not None, Dashboard.dashboard_title != "",
),
and_(Slice.slice_name is not None, Slice.slice_name != ""),
)
Expand Down Expand Up @@ -1252,10 +1242,7 @@ def recent_activity( # pylint: disable=no-self-use
Slice.slice_name,
)
.outerjoin(Dashboard, Dashboard.id == subqry.c.dashboard_id)
.outerjoin(
Slice,
Slice.id == subqry.c.slice_id,
)
.outerjoin(Slice, Slice.id == subqry.c.slice_id,)
.filter(has_subject_title)
.order_by(subqry.c.dttm.desc())
.limit(limit)
Expand Down Expand Up @@ -2514,9 +2501,7 @@ def fetch_datasource_metadata(self) -> FlaskResponse: # pylint: disable=no-self

datasource_id, datasource_type = request.args["datasourceKey"].split("__")
datasource = ConnectorRegistry.get_datasource(
datasource_type,
datasource_id,
db.session,
datasource_type, datasource_id, db.session,
)
# Check if datasource exists
if not datasource:
Expand Down
6 changes: 2 additions & 4 deletions tests/import_export_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,8 @@ def test_export_2_dashboards(self):
self.login("admin")
birth_dash = self.get_dash_by_slug("births")
world_health_dash = self.get_dash_by_slug("world_health")
export_dash_url = (
"/dashboard/export_dashboards_form?id={}&id={}&action=go".format(
birth_dash.id, world_health_dash.id
)
export_dash_url = "/dashboard/export_dashboards_form?id={}&id={}&action=go".format(
birth_dash.id, world_health_dash.id
)
resp = self.client.get(export_dash_url)
resp_data = json.loads(resp.data.decode("utf-8"), object_hook=decode_dashboards)
Expand Down

0 comments on commit 858289f

Please sign in to comment.