Skip to content

Commit

Permalink
fixup: use get_ to imply inference of a new field from an existing field
Browse files Browse the repository at this point in the history
set_* is usually used to set a value in an existing field, use get_*
to imply inference of a new field from an existing field.
  • Loading branch information
j23414 committed Feb 13, 2024
1 parent d223e77 commit 09170ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ingest/bin/infer-dengue-serotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def parse_args():
return parser.parse_args()


def _set_dengue_serotype(record, col="virus_tax_id"):
def _get_dengue_serotype(record, col="virus_tax_id"):
"""Set dengue serotype from virus_tax_id"""
dengue_types = {
"11053": "denv1",
Expand All @@ -44,7 +44,7 @@ def main():

for record in stdin:
record = json.loads(record)
record[args.out_col] = _set_dengue_serotype(record, col=args.virus_tax_id)
record[args.out_col] = _get_dengue_serotype(record, col=args.virus_tax_id)
stdout.write(json.dumps(record) + "\n")


Expand Down

0 comments on commit 09170ac

Please sign in to comment.