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

Wrong error when adding keywords #587

Closed
jthorton opened this issue Apr 9, 2020 · 2 comments
Closed

Wrong error when adding keywords #587

jthorton opened this issue Apr 9, 2020 · 2 comments

Comments

@jthorton
Copy link
Contributor

jthorton commented Apr 9, 2020

Describe the bug

When adding keywords to a collection with the same alias and program I think the wrong error is raised this should be a KeyError but an AttributeError is raised.

To Reproduce

client = FractalClient()
ds = client.get_collection('Dataset','OpenFF Discrepancy Benchmark 1')
# get the keywords
kw = ds.get_keywords('default', 'psi4')
# try and add them again to the collection
ds.add_keywords(alias='default', program='psi4', keyword=kw, default=False)

Expected behavior

Should raise the KeyError defined here

raise KeyError("Alias '{}' already set for program {}.".format(alias, keyword.program))

Additional context

@bennybp
Copy link
Contributor

bennybp commented Apr 10, 2020

Should be a simple fix. I think keyword.program should be replaced by just program in that exception

bennybp added a commit that referenced this issue Nov 1, 2020
Fix incorrect error in datasets (issue #587)
@bennybp
Copy link
Contributor

bennybp commented Nov 1, 2020

Fixed in PR #638

@bennybp bennybp closed this as completed Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants