Skip to content

Commit

Permalink
Some tailoring of columns sanitization
Browse files Browse the repository at this point in the history
If columns are None, don't check if they are fine, they will be
Don't check on "Taxonomic lineage" columns, for now those will be ignored
  • Loading branch information
iquasere committed Dec 19, 2023
1 parent 15d38ab commit c2a00b4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions upimapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,13 @@ def get_arguments():
args.columns = args.columns.split('&') if args.columns else None

columns_fine = True
for col in args.columns:
if col not in columns_dict.keys():
print(
f'ERR: [{col}] is not a valid column name for ID mapping. For more information, check '
f'https://github.com/iquasere/UPIMAPI/tree/master#sometimes-the-return-fields-are-not-properly-updated')
columns_fine = False
if args.columns:
for col in args.columns:
if col not in columns_dict.keys() and not col.startswith('Taxonomic lineage'):
print(
f'ERR: [{col}] is not a valid column name for ID mapping. For more information, check '
f'https://github.com/iquasere/UPIMAPI/tree/master#sometimes-the-return-fields-are-not-properly-updated')
columns_fine = False
if not columns_fine:
sys.exit(1)
if args.taxids is not None:
Expand Down

0 comments on commit c2a00b4

Please sign in to comment.