Skip to content

feat: Add validation to _from_gnomad in translator - #148

Merged
korikuzma merged 7 commits into
mainfrom
issue-147
Jan 17, 2023
Merged

korikuzma merged 7 commits into
mainfrom
issue-147

Conversation

@korikuzma

Copy link
Copy Markdown
Contributor

Close #147

  • Update regex for input str Screen Shot 2023-01-13 at 10 56 12 AM
  • Validate that expected reference sequence matches actual reference sequence
  • Cassettes were automatically generated
  • Updated translator test to match latest VRS docs example since the previous test had an invalid reference sequence

- Update regex for input str
- Validate that expected reference sequence matches actual reference
  sequence
@korikuzma
korikuzma requested a review from wesleygoar January 13, 2023 15:58
@korikuzma korikuzma self-assigned this Jan 13, 2023
@korikuzma
korikuzma requested review from a team as code owners January 13, 2023 15:58
@korikuzma

Copy link
Copy Markdown
Contributor Author

See this comment regarding requiring valid input or not: #147 (comment)

This determines whether or not validation checks must pass in order for
a VRS Allele to be returned
@korikuzma
korikuzma requested a review from wesleygoar January 16, 2023 16:04
- Raise ValidationError if set to True and validation checks fail
@korikuzma

korikuzma commented Jan 16, 2023 •

Copy link
Copy Markdown
Contributor Author

I decided to raise a ValueError if require_validation=True since these lines in translate_from would not give a descriptive error message

if o is None:
raise ValueError(f"Unable to parse data as {fmt} variation")

Open to other ways of implementing!

@korikuzma
korikuzma requested a review from wesleygoar January 17, 2023 12:55
Comment thread src/ga4gh/vrs/extras/translator.py Outdated
Comment thread src/ga4gh/vrs/extras/translator.py
Comment thread src/ga4gh/vrs/extras/translator.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add input validation for _from_gnomad

3 participants