8000 CLN: F-string formatting in pandas/_libs/*.pyx by ShaharNaveh · Pull Request #29527 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

CLN: F-string formatting in pandas/_libs/*.pyx #29527

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

Merged
merged 16 commits into from
Nov 11, 2019
Prev Previous commit
Next Next commit
Finished hashing.pyx
  • Loading branch information
MomIsBestFriend committed Nov 10, 2019
commit e64e327de3fa849b7e6a0fb5f578ce8acc7be0c9
10 changes: 5 additions & 5 deletions pandas/_libs/hashing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def hash_object_array(object[:] arr, object key, object encoding='utf8'):
k = <bytes>key.encode(encoding)
kb = <uint8_t *>k
if len(k) != 16:
raise ValueError("key should be a 16-byte string encoded, "
"got {key} (len {klen})".format(key=k, klen=len(k)))
raise ValueError(f"key should be a 16-byte string encoded, "
f"got {k} (len {len(k)})")

n = len(arr)

Expand All @@ -67,9 +67,9 @@ def hash_object_array(object[:] arr, object key, object encoding='utf8'):
data = <bytes>str(val).encode(encoding)

else:
raise TypeError("{val} of type {typ} is not a valid type "
"for hashing, must be string or null"
.format(val=val, typ=type(val)))
raise TypeError(f"{val} of type {type(val)} is not a valid type "
f"for hashing, must be string or null"
)

l = len(data)
lens[i] = l
Expand Down
0