From 9691e225724e041997c74f8665dcbfa12bb1c579 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 11 Mar 2022 11:51:02 +0300 Subject: Fix some linting issues --- gn3/api/async_commands.py | 6 ++---- gn3/api/correlation.py | 6 ------ 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'gn3/api') diff --git a/gn3/api/async_commands.py b/gn3/api/async_commands.py index 81c3c44..c0cf4bb 100644 --- a/gn3/api/async_commands.py +++ b/gn3/api/async_commands.py @@ -1,6 +1,4 @@ """Endpoints and functions concerning commands run in external processes.""" -import json - import redis from flask import jsonify, Blueprint @@ -8,11 +6,11 @@ async_commands = Blueprint("async_commands", __name__) @async_commands.route("/state/") def command_state(command_id): + """Respond with the current state of command identified by `command_id`.""" with redis.Redis(decode_responses=True) as rconn: state = rconn.hgetall(name=command_id) if not state: return jsonify( status=404, error="The command id provided does not exist.") - state = {key: val for key,val in state.items()} - return jsonify(state) + return jsonify(dict(state.items())) diff --git a/gn3/api/correlation.py b/gn3/api/correlation.py index 67897e8..7eb7cd6 100644 --- a/gn3/api/correlation.py +++ b/gn3/api/correlation.py @@ -1,6 +1,5 @@ """Endpoints for running correlations""" import sys -import json from functools import reduce import redis @@ -17,7 +16,6 @@ from gn3.computations.correlations import map_shared_keys_to_values from gn3.computations.correlations import compute_tissue_correlation from gn3.computations.correlations import compute_all_lit_correlation from gn3.computations.correlations import compute_all_sample_correlation -from gn3.computations.partial_correlations import partial_correlations_entry correlation = Blueprint("correlation", __name__) @@ -132,7 +130,3 @@ def partial_correlation(): int(args.get("criteria", 500))), job_queue=current_app.config.get("REDIS_JOB_QUEUE"), env = {"PYTHONPATH": ":".join(sys.path), "SQL_URI": SQL_URI})}) - -@correlation.route("/partial/", methods=["GET"]) -def partial_correlation_results(): - raise Exception("Not implemented!!") -- cgit v1.2.3