Skip to content

Uncaught error in curate transform-strain-name #1906

@corneliusroemer

Description

@corneliusroemer

Curate seems to struggle with null JSON values?

$  augur curate transform-strain-name \
                --strain-regex '^.+$' \
                --backup-fields submissionId accession
...
Traceback (most recent call last):
  File "/Users/cr/code/augur/augur/__init__.py", line 71, in run
    return args.__command__.run(args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cr/code/augur/augur/curate/__init__.py", line 246, in run
    dump_ndjson(validated_output_records)
  File "/Users/cr/code/augur/augur/io/json.py", line 89, in dump_ndjson
    for item in iterable:
                ^^^^^^^^
  File "/Users/cr/code/augur/augur/curate/__init__.py", line 154, in validate_records
    for idx, record in enumerate(records):
                       ^^^^^^^^^^^^^^^^^^
  File "/Users/cr/code/augur/augur/curate/transform_strain_name.py", line 72, in run
    transform_name(
  File "/Users/cr/code/augur/augur/curate/transform_strain_name.py", line 21, in transform_name
    if strain_name_pattern.match(record.get("strain", "")) is None:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'

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