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

Can't get functions from registry if entry points only points to the correct module and not to the specific functions #12

Open
NixBiks opened this issue Feb 18, 2021 · 1 comment

Comments

@NixBiks
Copy link

NixBiks commented Feb 18, 2021

I'm getting this extremely odd error that tells me chain.v1 is not available while it is showing up as available name at the same time.

catalogue.RegistryError: Cant't find 'chain.v1' in registry horizon -> components. Available names: Pipeline.v1, _, chain.v1, fetch.v1, response_to_bytes.v1, response_to_dict.v1, response_to_text.v1

I've tried to run my test in debug mode with a break point where the error occurs. If I run Registry.get then it fails as in the test but if I run Registry.get() a second time then it works.

Reason

In Registry.get() we only look for the specific name, i.e. from_entry_point = self.get_entry_point(name) or in the global variable REGISTRY. It doesn't exist in either in the first run. But in the second run it does exist in REGISTRY since we called Registry.get_entry_points() to print the error message, since this method actually load all the modules in the entry points and thereby populates REGISTRY.

Proposed solution

Load all modules from entry points in Registry.get() if there is entry points but the requested one is found directly.

@NixBiks NixBiks changed the title Odd behavior with entry points when running my tests with pytest Can't get functions from registry if entry points only points to the correct module and not to the specific functions Feb 18, 2021
@adrianeboyd
Copy link
Contributor

Are you still running into issues related to this? We haven't had any other related reports and without any tests, I'm a little hesitant about the changes in #13.

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

Successfully merging a pull request may close this issue.

2 participants