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

Commit

Permalink
fix: better valueerror message
Browse files Browse the repository at this point in the history
  • Loading branch information
bokajgd committed Nov 18, 2022
1 parent ba2d4c5 commit d92f798
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,16 @@ 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()))
if len(invalid_loaders) != 0:
raise ValueError(f"""Following loaders were not found in data_loaders registry:{' '.join(str(loader) for loader in invalid_loaders)}
Available loaders: {' '.join(str(loader) for loader in data_loaders.get_all())}""")
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())}""")

if self.output_col_name_override:
input_col_name = (
Expand Down Expand Up @@ -316,6 +317,7 @@ def create_specs_from_group(

# Create all combinations of top level elements
# For each attribute in the FeatureGroupSpec

feature_group_spec_dict = feature_group_spec.__dict__

permuted_dicts = create_feature_combinations_from_dict(d=feature_group_spec_dict)
Expand Down

0 comments on commit d92f798

Please sign in to comment.