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

query_utils.py and get_update_query #2

Open
iosonopersia opened this issue Jan 8, 2021 · 0 comments
Open

query_utils.py and get_update_query #2

iosonopersia opened this issue Jan 8, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@iosonopersia
Copy link
Collaborator

In order to avoid problems related to the eventual occurence of circular dependencies, a "hack" was put in place in the get_update_query function of the support/query_utils.py module. Since we need to know what type of entity has been passed to the function as argument (GraphEntity, ProvEntity or MetadataEntity) and at the same time we cannot use the builtin function isinstance (since it would require us to import GraphEntity, ProvEntity and MetadataEntity, leading to circular dependencies), then whoever needs to use this function must do the "isinstance check" and pass to get_update_query a string with one of these values: "graph", "prov" or "metadata".

This is surely not a good design choice and it should be fixed. It should also be investigated if the circular dependency appears only when testing with "poetry run test" (which in turn uses unittest that tries to load every module, and also the __init__.py files that cause the problem). All the internal import statements must always have a full path to the required module, since this ensures that __init__.py files are bypassed. This should avoid circular dependencies at runtime.

@iosonopersia iosonopersia added the enhancement New feature or request label Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant