diff --git a/apps/cli/executables/pexable/data_annotator/data_annotator/annotator.py b/apps/cli/executables/pexable/data_annotator/data_annotator/annotator.py index 5e7c6dea8bceaeb19ff526207610aa8fa717e641..00115fd42516f5432a618777547a58e665c79afe 100644 --- a/apps/cli/executables/pexable/data_annotator/data_annotator/annotator.py +++ b/apps/cli/executables/pexable/data_annotator/data_annotator/annotator.py @@ -67,9 +67,9 @@ def parser() -> argparse.ArgumentParser: help="Two strings representing beginning and end date to search by.", ) search_group.add_argument( - "--fsid", + "--external-name", action="store", - help="A string representing the FSID to search by", + help="A string representing the external name to search by", ) search_group.add_argument( "--configuration", @@ -149,7 +149,7 @@ def main(): args.comment = input(prompt) # Find the initial execution blocks, use them to find all relevant science product locators and proceed - ebs = get_exec_blocks(args.project_code, args.date_range, args.fsid, args.band, args.configuration, conn) + ebs = get_exec_blocks(args.project_code, args.date_range, args.external_name, args.band, args.configuration, conn) all_spls = get_all_spls_from_exec_blocks(ebs, conn) if args.create: create_comments(all_spls, args.comment, args.problem_severity, args.problem_type, conn) diff --git a/apps/cli/executables/pexable/data_annotator/data_annotator/queries.py b/apps/cli/executables/pexable/data_annotator/data_annotator/queries.py index ee48cb700041008d0de4e60fcd9d44578322cfe6..e67c42c74f79ab2955cf37a5e015989cf5247d7e 100644 --- a/apps/cli/executables/pexable/data_annotator/data_annotator/queries.py +++ b/apps/cli/executables/pexable/data_annotator/data_annotator/queries.py @@ -24,13 +24,13 @@ def retrieve_problem_severities(connection): rows = cur.fetchall() return rows -def get_exec_blocks(project_code, date_range, fsid, band, configuration, connection): +def get_exec_blocks(project_code, date_range, external_name, band, configuration, connection): """ Finds all execution blocks associated with a user's query by building and executing a SQL query :param project_code: a string corresponding to the project_code field in the database :param date_range: a tuple corresponding to the starttime and endtime fields in the database - :param fsid: a string corresponding to the external name field in the database + :param external_name: a string corresponding to the external name field in the database :param band: a string corresponding to the band field in the database :param configuration: a string corresponding to the configuration field in the database :param connection: a MDDBConnector object to interface with the database @@ -39,13 +39,13 @@ def get_exec_blocks(project_code, date_range, fsid, band, configuration, connect # Format WHERE clauses with provided search pieces project_code = f"project_code='{project_code}' AND " if project_code else '' date_range = f"starttime>={date_range[0]} AND endtime<={date_range[1]} AND " if date_range else '' - fsid = f"external_name='{fsid}' AND " if fsid else '' + external_name = f"external_name='{external_name}' AND " if external_name else '' configuration = f"configuration='{configuration}' AND " if configuration else '' band = f"band='{band}'" if band else '' search_command = f"SELECT execution_block_id, execution_blocks.science_product_locator FROM execution_blocks \ INNER JOIN science_products ON execution_blocks.science_product_locator=science_products.science_product_locator \ - WHERE {project_code}{configuration}{date_range}{fsid}{band}" + WHERE {project_code}{configuration}{date_range}{external_name}{band}" # Remove trailing ANDs, if necessary if search_command[-4:] == 'AND ':