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

[ENH] More user-friendly handling of input decoding/reading errors #337

Merged
merged 9 commits into from
Aug 16, 2024

Conversation

alyssadai
Copy link
Contributor

@alyssadai alyssadai commented Aug 15, 2024

Changes proposed in this pull request:

  • Explicitly require UTF-8 encoding of inputs for the bagel pheno command
  • Print informative error message (without a traceback!) when a UnicodeDecodeError or JSONDecodeError are encountered
  • Return more details about offending entry in data dict when jsonschema validation fails

For reviewer: Any thoughts on whether this should have the pr-patch or pr-bug-fix label?

Checklist

This section is for the PR reviewer

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see our Contributing Guidelines for more info)
  • PR has a label for the release changelog or skip-release (to be applied by maintainers only)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

@alyssadai alyssadai added the pr-patch Incremental feature improvement, will increment patch version when merged (0.0.+1) label Aug 15, 2024
Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.06%. Comparing base (5813406) to head (3ade62c).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #337      +/-   ##
==========================================
+ Coverage   97.98%   98.06%   +0.07%     
==========================================
  Files          13       13              
  Lines         746      775      +29     
==========================================
+ Hits          731      760      +29     
  Misses         15       15              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coveralls
Copy link
Collaborator

coveralls commented Aug 15, 2024

Pull Request Test Coverage Report for Build 10423411977

Details

  • 35 of 35 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 98.065%

Totals Coverage Status
Change from base Build 10379234725: 0.08%
Covered Lines: 760
Relevant Lines: 775

💛 - Coveralls

@alyssadai alyssadai marked this pull request as draft August 15, 2024 05:53
@alyssadai alyssadai marked this pull request as ready for review August 15, 2024 17:13
Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool PR, thanks @alyssadai!

I didn't try it out locally, I'm assuming this PR does not change the long stacktraces that typer is printing to the terminal on an error. I left a comment inline about whether our nicely formatted error messages would be hidden by the long stacktraces.

Also some 🍒, take a look.

🧑‍🍳

bagel/pheno_utils.py Show resolved Hide resolved
bagel/pheno_utils.py Show resolved Hide resolved
bagel/pheno_utils.py Show resolved Hide resolved
bagel/tests/test_utility.py Outdated Show resolved Hide resolved
bagel/utility.py Show resolved Hide resolved
@alyssadai alyssadai merged commit 4a331e6 into main Aug 16, 2024
11 checks passed
@alyssadai alyssadai deleted the specify-input-encoding branch August 16, 2024 17:31
Copy link
Contributor

🚀 PR was released in v0.3.0 🚀

@neurobagel-bot neurobagel-bot bot added the released This issue/pull request has been released. label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-patch Incremental feature improvement, will increment patch version when merged (0.0.+1) released This issue/pull request has been released.
Projects
None yet
3 participants