Skip to content

Commit

Permalink
Circumvent pyupgrade error
Browse files Browse the repository at this point in the history
For some strange reason, the pyupgrade wants to change the f-string set
construction f"{set(...)}" to f"{{...}}" in CI, running Python 3.12.
Weirdly enough, the error does not occur locally, and applying the
change would not work in Python 3.10, which cannot handle nested
f-strings. Creating the set upfront circumvents the problem.
  • Loading branch information
AdrianSosic committed Oct 21, 2024
1 parent 7af64bf commit db1f0b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion baybe/targets/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ def transform(
~series.isin([self.success_value, self.failure_value]).to_numpy()
]
if len(invalid) > 0:
valid = {self.success_value, self.failure_value}
raise InvalidTargetValueError(
f"The following values entered for target '{self.name}' are not in the "
f"set of accepted choice values "
f"{set((self.success_value, self.failure_value))}: {set(invalid)}"
f"{valid}: {set(invalid)}"
)

# Transform
Expand Down

0 comments on commit db1f0b1

Please sign in to comment.