Skip to content

Unhandled error in curate apply-geolocation-rules #1904

@corneliusroemer

Description

@corneliusroemer

There's an unhandled error in apply-geolocation-rules:

$ augur curate apply-geolocation-rules \
                --geolocation-rules /Users/cr/code/mpox/ingest/defaults/geolocation-rules.tsv \
                $INPUTFILE

Traceback (most recent call last):
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/__init__.py", line 71, in run
    return args.__command__.run(args)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/__init__.py", line 246, in run
    dump_ndjson(validated_output_records)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/io/json.py", line 89, in dump_ndjson
    for item in iterable:
                ^^^^^^^^
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/__init__.py", line 154, in validate_records
    for idx, record in enumerate(records):
                       ~~~~~~~~~^^^^^^^^^
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/apply_geolocation_rules.py", line 260, in run
    annotated_values = transform_geolocations(
        default_rules,
        [record.get(field, '') for field in location_fields],
        args.case_sensitive)
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/apply_geolocation_rules.py", line 169, in transform_geolocations
    annotated_values = get_annotated_geolocation(geolocation_rules, transformed_values, case_sensitive)
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/apply_geolocation_rules.py", line 115, in get_annotated_geolocation
    return get_annotated_geolocation(geolocation_rules, raw_geolocation, case_sensitive, rule_traversal)
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/apply_geolocation_rules.py", line 148, in get_annotated_geolocation
    return get_annotated_geolocation(geolocation_rules, raw_geolocation, case_sensitive, rule_traversal)
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/apply_geolocation_rules.py", line 115, in get_annotated_geolocation
    return get_annotated_geolocation(geolocation_rules, raw_geolocation, case_sensitive, rule_traversal)
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/apply_geolocation_rules.py", line 115, in get_annotated_geolocation
    return get_annotated_geolocation(geolocation_rules, raw_geolocation, case_sensitive, rule_traversal)
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/apply_geolocation_rules.py", line 148, in get_annotated_geolocation
    return get_annotated_geolocation(geolocation_rules, raw_geolocation, case_sensitive, rule_traversal)
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/apply_geolocation_rules.py", line 115, in get_annotated_geolocation
    return get_annotated_geolocation(geolocation_rules, raw_geolocation, case_sensitive, rule_traversal)
  File "/Users/cr/micromamba/envs/py13/lib/python3.13/site-packages/augur/curate/apply_geolocation_rules.py", line 101, in get_annotated_geolocation
    current_rules = current_rules.get(field_value.lower())
                                      ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'lower'


An error occurred (see above) that has not been properly handled by Augur.
To report this, please open a new issue including the original command and the error above:
    <https://github.com/nextstrain/augur/issues/new/choose>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions