Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Commit

Permalink
fix: bettee valueerror message formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bokajgd committed Nov 18, 2022
1 parent 60fd7db commit 7b3b994
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,21 @@ class MinGroupSpec(BaseModel):

allowed_nan_value_prop: list[float] = [0.0]
# If NaN is higher than this in the input dataframe during resolution, raise an error.

def __init__(self, **data):
super().__init__(**data)

# Check that all passed loaders are valid
invalid_loaders = list(set(self.values_loader) - set(data_loaders.get_all()))
invalid_loaders = list(
set(self.values_loader) - set(data_loaders.get_all().keys())
)
if len(invalid_loaders) != 0:
raise ValueError(f"""Invalid loader(s) specified. Following loaders were not found in the data_loaders registry:
{' '.join(str(loader) for loader in invalid_loaders)}
Available loaders:{' '.join(str(loader) for loader in data_loaders.get_all())}""")
nl = "\n" # New line variable as f-string can't handle backslashes
raise ValueError(
f"""Invalid loader(s) specified.{nl}{nl}Following loaders were not found in the data_loaders registry:"""
f"""{nl}{nl.join(str(loader) for loader in invalid_loaders)}{nl}{nl}"""
f"""Available loaders:{nl}{nl.join(str(loader) for loader in data_loaders.get_all().keys())}"""
)

if self.output_col_name_override:
input_col_name = (
Expand Down

0 comments on commit 7b3b994

Please sign in to comment.