Skip to content

Commit

Permalink
feat: at groupspec init, iterate over values_loader and check that th…
Browse files Browse the repository at this point in the history
…ey exist in the loader registry

Fixes #87
  • Loading branch information
bokajgd committed Nov 17, 2022
1 parent 9fc10b3 commit 04dfd7e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,20 @@ class MinGroupSpec(BaseModel):
def __init__(self, **data):
super().__init__(**data)

invalid_loaders = list()

for loader in self.values_loader:
try:
loader in data_loaders.get_all()
except:
invalid_loaders.append(loader)

if len(invalid_loaders) != 0:
nl = '\n'
raise ValueError(f"""Following loaders were not found in data_loaders registry: {nl}{nl.join(str(loader) for loader in invalid_loaders)}{nl}Available loaders: {nl}{nl.join(str(loader) for loader in data_loaders.get_all())}""")



if self.output_col_name_override:
input_col_name = (
"value"
Expand Down

0 comments on commit 04dfd7e

Please sign in to comment.