Skip to content

Commit

Permalink
fix: TypeError
Browse files Browse the repository at this point in the history
Fixes the following error when generating a 'paper_url' column from the numeric IDs in the 'publication' column

TypeError: can only concatenate str (not "float") to str
  • Loading branch information
j23414 committed Dec 8, 2022
1 parent 0c566ef commit ca65900
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ingest/bin/post_process_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ def _set_strain_name(record):

def _set_url(record):
"""Set url column from accession"""
return "https://www.ncbi.nlm.nih.gov/nuccore/" + record["accession"]
return "https://www.ncbi.nlm.nih.gov/nuccore/" + str(record["accession"])


def _set_paper_url(record):
"""Set paper_url from publication"""
if pd.notna(record["publications"]):
paper_url = "https://www.ncbi.nlm.nih.gov/pubmed/" + record["publications"]
paper_url = "https://www.ncbi.nlm.nih.gov/pubmed/" + str(record["publications"])
return paper_url.split(",")[0]
return ""

Expand Down

0 comments on commit ca65900

Please sign in to comment.