aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
Diffstat (limited to 'gn3')
-rw-r--r--gn3/api/correlation.py2
-rw-r--r--gn3/commands.py5
-rw-r--r--gn3/computations/diff.py2
3 files changed, 5 insertions, 4 deletions
diff --git a/gn3/api/correlation.py b/gn3/api/correlation.py
index f2ac4d7..67897e8 100644
--- a/gn3/api/correlation.py
+++ b/gn3/api/correlation.py
@@ -112,7 +112,7 @@ def partial_correlation():
return reduce(__field_errors__(request_data), fields, errors)
- args = json.loads(request.get_json())
+ args = request.get_json()
request_errors = __errors__(
args, ("primary_trait", "control_traits", "target_db", "method"))
if request_errors:
diff --git a/gn3/commands.py b/gn3/commands.py
index 29e3df2..0e0b53c 100644
--- a/gn3/commands.py
+++ b/gn3/commands.py
@@ -84,11 +84,12 @@ Returns the name of the specific redis hash for the specific task.
f"{str(uuid4())}")
conn.rpush(job_queue, unique_id)
for key, value in {
- "cmd": json.dumps(cmd), "result": "", "status": "queued",
- "env": json.dumps(env)}.items():
+ "cmd": json.dumps(cmd), "result": "", "status": "queued"}.items():
conn.hset(name=unique_id, key=key, value=value)
if email:
conn.hset(name=unique_id, key="email", value=email)
+ if env:
+ conn.hset(name=unique_id, key="env", value=json.dumps(env))
return unique_id
diff --git a/gn3/computations/diff.py b/gn3/computations/diff.py
index af02f7f..0b6edd6 100644
--- a/gn3/computations/diff.py
+++ b/gn3/computations/diff.py
@@ -6,7 +6,7 @@ from gn3.commands import run_cmd
def generate_diff(data: str, edited_data: str) -> Optional[str]:
"""Generate the diff between 2 files"""
- results = run_cmd(f"diff {data} {edited_data}", success_codes=(1, 2))
+ results = run_cmd(f'"diff {data} {edited_data}"', success_codes=(1, 2))
if results.get("code", -1) > 0:
return results.get("output")
return None