Skip to content

Commit

Permalink
Improve error message for missing function parameters (#6232)
Browse files Browse the repository at this point in the history
* Improve error message for missing function parameters

The error message in the fingerprint module was missing the f-string 'f' symbol, so the error message returned by fingerprint.py, line 469 was literally "function {func} is missing parameters {fingerprint_names} in signature."

This has been fixed.

* Replace __name__ with  __qualname__

* Revert

---------

Co-authored-by: James Orcutt <eorcutt@bloombergindustry.com>
Co-authored-by: Mario Šaško <mariosasko777@gmail.com>
  • Loading branch information
3 people authored Sep 15, 2023
1 parent 94e0796 commit 9b21e18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datasets/fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def fingerprint_transform(

def _fingerprint(func):
if not inplace and not all(name in func.__code__.co_varnames for name in fingerprint_names):
raise ValueError("function {func} is missing parameters {fingerprint_names} in signature")
raise ValueError(f"function {func} is missing parameters {fingerprint_names} in signature")

if randomized_function: # randomized function have seed and generator parameters
if "seed" not in func.__code__.co_varnames:
Expand Down

0 comments on commit 9b21e18

Please sign in to comment.