Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly error on duplicates in parse and filter, handle AugurError globally #918

Merged
merged 6 commits into from
May 12, 2022

Commits on May 10, 2022

  1. Catch AugurError in top-level exception handler

    Rename the unused AugurException as AugurError, to be consistent with NextstrainCliError: https://github.com/nextstrain/cli/blob/8ec779b489254c3abb7bbbf4a8f3694c4ade854e/nextstrain/cli/errors.py#L7
    victorlin committed May 10, 2022
    Configuration menu
    Copy the full SHA
    2342f07 View commit details
    Browse the repository at this point in the history

Commits on May 12, 2022

  1. Error on duplicates in augur parse

    Previously, augur parse would let duplicates pass silently with the following behavior:
    
    - sequence output contains all duplicates
    - metadata output contains only the last occurrence of duplicates
    
    The behavior is unintentional and undocumented.
    
    This small change will immediately raise an error and exit when a duplicate is detected.
    victorlin committed May 12, 2022
    Configuration menu
    Copy the full SHA
    abb7f1b View commit details
    Browse the repository at this point in the history
  2. Make FilterException inherit AugurError

    This isn't used for anything now, but would make things easier if there is any need to add properties/methods to all custom exceptions in the project.
    victorlin committed May 12, 2022
    Configuration menu
    Copy the full SHA
    bab414e View commit details
    Browse the repository at this point in the history
  3. Add function io.print_err()

    print(file=sys.stderr) is used a lot in the codebase. This new function print_err acts as an alias to the original call.
    victorlin committed May 12, 2022
    Configuration menu
    Copy the full SHA
    185218c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ee8d17e View commit details
    Browse the repository at this point in the history
  5. Error on metadata duplicates in augur filter

    Previously, augur filter would let fail on duplicates with a cryptic error:
    
        AttributeError: 'DataFrame' object has no attribute 'name'
    
    This small change will immediately raise a more meaningful error and properly exit when a duplicate is detected.
    victorlin committed May 12, 2022
    Configuration menu
    Copy the full SHA
    dd783ec View commit details
    Browse the repository at this point in the history