From 47686b74aa4ca4f1dee5c7174b4f4dc54b1a1de8 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 12 Apr 2022 13:22:11 +0300 Subject: Replace get_allowable_sampledata_headers with get_case_attributes * wqflask/wqflask/metadata_edits.py: Remove "get_allowable_sampledata_headers" import. (display_phenotype_metadata): Use "get_case_attributes" to fetch all the allowable case attributes. --- wqflask/wqflask/metadata_edits.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py index ec6c9e7a..7fa0b310 100644 --- a/wqflask/wqflask/metadata_edits.py +++ b/wqflask/wqflask/metadata_edits.py @@ -29,7 +29,6 @@ from gn3.authentication import get_highest_user_access_role from gn3.csvcmp import create_dirs_if_not_exists from gn3.csvcmp import csv_diff from gn3.csvcmp import extract_invalid_csv_headers -from gn3.csvcmp import get_allowable_sampledata_headers from gn3.csvcmp import remove_insignificant_edits from gn3.db import diff_from_dict from gn3.db import fetchall @@ -208,7 +207,7 @@ def display_phenotype_metadata(dataset_id: str, name: str): publication=_d.get("publication"), dataset_id=dataset_id, resource_id=request.args.get("resource-id"), - headers=get_allowable_sampledata_headers(conn), + headers=get_case_attributes(conn).keys(), version=os.environ.get("GN_VERSION"), ) @@ -272,7 +271,6 @@ def update_phenotype(dataset_id: str, name: str): ), epsilon=0.001, ) - headers = get_allowable_sampledata_headers(conn) invalid_headers = extract_invalid_csv_headers( allowed_headers=headers, csv_text=delta_csv ) @@ -688,7 +686,6 @@ def show_case_attribute_columns(): case_attributes = {} with database_connection() as conn: case_attributes = get_case_attributes(conn) - for key, val in case_attributes.items(): if not val: case_attributes[key] = "No description" -- cgit v1.2.3