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

Replace .decode method with str(bytes, "utf-8") #1998

Merged
merged 5 commits into from
May 3, 2024
Merged

Conversation

tetron
Copy link
Member

@tetron tetron commented May 3, 2024

This is because some bytes-like objects (such as memoryview) don't have a "decode()" method. It appears that the preferred way to get a decoded string is to simply call the constructor with the bytes-like object and the desired encoding.

This is because some bytes-like objects (such as memoryview) don't
have a "decode()" method.  It appears that the preferred way to get a
decoded string is to simply call the constructor with the bytes-like
object and the desired encoding.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
Copy link

codecov bot commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.83%. Comparing base (22fc2c2) to head (7702c4f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1998   +/-   ##
=======================================
  Coverage   83.83%   83.83%           
=======================================
  Files          46       46           
  Lines        8245     8245           
  Branches     2190     2190           
=======================================
  Hits         6912     6912           
- Misses        856      857    +1     
+ Partials      477      476    -1     

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

tetron added 3 commits May 3, 2024 11:03
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
@tetron
Copy link
Member Author

tetron commented May 3, 2024

I guess what it is telling me is that because I added tests, but the tests are not exhaustive of all lines/branches of the newly tested functions, the % total coverage actually went down. Argh.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
@tetron tetron requested a review from mr-c May 3, 2024 17:31
@mr-c mr-c merged commit 0ced372 into main May 3, 2024
45 checks passed
@mr-c mr-c deleted the bytes-str-decode branch May 3, 2024 17:35
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.

None yet

2 participants