Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GaussianCopula: ValueError: not enough values to unpack (expected 2, got 1) #220

Closed
csala opened this issue Oct 26, 2020 · 1 comment
Closed
Assignees
Labels
internal The issue doesn't change the API or functionality
Milestone

Comments

@csala
Copy link
Contributor

csala commented Oct 26, 2020

  • SDV version: 0.4.5

Description

If an invalid distribution name is passed to GaussianCopula, it crashes with an unclear message.

To fix this, all the inputted distribution names should be validated to ensure that they are valid and raise a user-friendly message if they are not.

What I Did

In [7]: from sdv.demo import load_tabular_demo                                                                                                                                                                                                                                 

In [8]: data = load_tabular_demo()                                                                                                                                                                                                                                             

In [11]: model = GaussianCopula(distribution={'age': 'invalid_distribution_name'})                                                                                                                                                                                                               

In [12]: model.fit(data)                                                                                                                                                                                                                                                       
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-12-bcfd88bde046> in <module>
...
~/.virtualenvs/SDV.clean/lib/python3.6/site-packages/copulas/__init__.py in get_instance(obj, **kwargs)
     51     instance = None
     52     if isinstance(obj, str):
---> 53         package, name = obj.rsplit('.', 1)
     54         instance = getattr(importlib.import_module(package), name)(**kwargs)
     55 

ValueError: not enough values to unpack (expected 2, got 1)
@csala csala added the internal The issue doesn't change the API or functionality label Oct 26, 2020
@csala csala self-assigned this Nov 4, 2020
@csala csala added this to the 0.4.6 milestone Nov 24, 2020
@csala
Copy link
Contributor Author

csala commented Nov 24, 2020

This was fixed as part of #251

@csala csala closed this as completed Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal The issue doesn't change the API or functionality
Projects
None yet
Development

No branches or pull requests

1 participant