From 17abad9300e4a96a14f94da486ef8307f7d27e06 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 6 Apr 2023 12:31:05 +0300 Subject: Remove deprecated `gn3.db_utils.database_connector` function Remove the deprecated function and fix a myriad of bugs that arise from removing the function. Issue: https://issues.genenetwork.org/issues/bugfix_coupling_current_app_and_db_utils --- scripts/partial_correlations.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/partial_correlations.py b/scripts/partial_correlations.py index 1fbab78..aab8f08 100644 --- a/scripts/partial_correlations.py +++ b/scripts/partial_correlations.py @@ -4,7 +4,7 @@ import json import traceback from argparse import ArgumentParser -from gn3.db_utils import database_connector +from gn3.db_utils import database_connection from gn3.responses.pcorrs_responses import OutputEncoder from gn3.computations.partial_correlations import ( partial_correlations_with_target_db, @@ -108,6 +108,10 @@ def process_cli_arguments(): help="The correlation method to use", type=str, choices=("pearsons", "spearmans")) + parser.add_argument( + "sql_uri", + help="The uri to use to connect to the database", + type=str) against_db_parser(against_traits_parser( parser.add_subparsers( title="subcommands", @@ -119,7 +123,7 @@ def main(): """Entry point for the script""" args = process_cli_arguments() - with database_connector() as conn: + with database_connection(args.sql_uri) as conn: print(json.dumps(run_pcorrs(conn, args), cls=OutputEncoder)) -- cgit v1.2.3